I have the HTML in my DOM, you can find the HTML code below. I would like to write the javascript function which return me image and font tags by id. How can I do this?
<ul id="ChatUsers">
<li class="ajaxchat_Available" id="ajaxchat_42">
<img src="http://cash.co/modules/mod_ajaxchat/images/countryflags/us.gif">
<strong>
<a onclick="javascript:chatWith(42, 'us',) 'darkgreen')" href="javascript:void(0)">
<font color="darkgreen"><b> Admin</b></font>
</a>
</strong>
</li>
<li class="ajaxchat_Available" id="ajaxchat_48"
<img src="http://cash.co/modules/mod_ajaxchat/images/countryflags/xx.gif">
<strong>
<a onclick="javascript:chatWith(48, 'xx', '#ff0000')" href="javascript:void(0)">
<font color="#ff0000"> tony</font>
</a>
</strong>
</li>
</ul>
How can I write the function which return me img and font tags by id?
function get_data_by_id(42) {
...
jQuery filter code here...
return {
img: '<img src="http://cash.co/modules/mod_ajaxchat/images/countryflags/us.gif">',
font: '<font color="darkgreen"><b> Admin</b></font>'
}
Thanks!