jquery - Checkbox and label created on the fly -


when create checkbox , label "on fly" jquery, works fine respect functionality (that is: if click label, checkbox checked), default visual appearance browser assigns label isn't same default visual appearance assigned label created not-on-the-fly.

[x] normal label [x]label created on fly 

the difference space (a margin) between label , check box.

any ideas on happening here?

the code checkbox/label creation on fly following:

 $('<input type="checkbox" id="foo"/><label for="foo">bar</label>') 

the code checkbox/label creation not-on-the-fly following:

 <input type="checkbox" id="baz"/><label for="baz">quz</label> 

this happening: http://jsfiddle.net/ksjjz/

 <body>      <ul id="bla">          <li>              <input type="checkbox" id="baz"/><label for="baz">quz</label>          </li>          <li>              <input type="checkbox" id="foo"/>              <label for="foo">quz</label>          </li>      </ul>  </body> 

basically, theres space interpretation if these 2 tags (input , label) separated \r\n


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -