var attr = {"<tr>":"id=tr1","<td>":"id=td1;value=some text here"}
for ( var key in attrs) { var currentattr=attrs[key]
if(currentattr.indexOf(";")>-1){
currentattr=currentattr.split(";")
jQuery.each(currentattr, function(i, val) {
var currattr1=val.split("=")
var currentattrname,currentattrvalue;
currentattrname=currattr1[0]
currentattrvalue=currattr1[1]
if(currentattrname=="value"){
$(key).append("some text here ...")
}
})
}
}
here im trying to split the input by using split and adding each node to the root to create dynamic html content. I am new to jquery. Please review the code and let me know any modification will make the code more flexible using jquery features.

New Topic/Question
Reply


MultiQuote



|