javascript - Appending spans to li -


i've html

<div>     <ul id="one"></ul>  </div> 

and code appending li element ul

$("#one").append("<li id='libtn2630275chat'><img id='imgbtn2630275chat' width='10' height='10' title='in queue' alt='' src='/content/themes/images/queue.png'/><input type='button' class='btnsend' id='btn2630275chat' value='jordan' onclick='fnbtnchatuserclick()' /><span id='spnpendingmessagebtn2630275chat'  class='display_none'>(<span='spnpendingmessagecountbtn2630275chat'  class='display_none'>0</span>)</span></li>"); 

now problem last ) not added inside span spnpendingmessagebtn2630275chat. see attached image

enter image description here

why not being included in span, , how can resolved?

fiddle: fiddle

replace line code:

$("#one").append("<li id='libtn2630275chat'><img id='imgbtn2630275chat' width='10' height='10' title='in queue' alt='' src='/content/themes/images/queue.png'/><input type='button' class='btnsend' id='btn2630275chat' value='jordan'  /><span id='spnpendingmessagebtn2630275chat'  class='display_none'>(<span id='spnpendingmessagecountbtn2630275chat' class='display_none'>0</span>)</span></li>"); 

you forgot write 'id' before '=' in span tag.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -