Find and set css to html element in variable
<p>Suppose i have variable in js and that variable has html as text
like</p>

<pre><code>sHtml = "&lt;div id='dvPrint' &gt;&lt;table&gt;";
sHtml += "&lt;tr&gt;&lt;td&gt;" + "&lt;img src='" + ImgPath + "' height='900' width='600' border='0'/&gt;" + "&lt;/td&gt;&lt;/tr&gt;";
sHtml += "&lt;tr&gt;&lt;td&gt;" + $('#lblTxt').html() + "&lt;/td&gt;&lt;/tr&gt;";
sHtml += "&lt;/table&gt;&lt;/div&gt;";
</code></pre>

<p>So how could I set css to img element by jquery because it is stored in js variable.</p>

<h2>can i set css in the below way</h2>

<pre><code>sHtml = "&lt;div id='dvPrint'&gt;&lt;table&gt;";
sHtml += "&lt;tr&gt;&lt;td&gt;" + "&lt;img src='" + ImgPath + "' border='0'/&gt;" + "&lt;/td&gt;&lt;/tr&gt;";
sHtml += "&lt;tr&gt;&lt;td&gt;" + $('#lblTxt').html() + "&lt;/td&gt;&lt;/tr&gt;";
sHtml += "&lt;/table&gt;&lt;/div&gt;";
var $dvPrint = $(sHtml);
$dvPrint.addClass('imageCss');
</code></pre>

<p>plzz tell me is there anything wrong. thanks</p>
