Javascript: Difference between revisions

From LemonWiki共筆
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 8: Line 8:
[http://www.w3schools.com/tags/att_select_form.asp HTML select form Attribute]
[http://www.w3schools.com/tags/att_select_form.asp HTML select form Attribute]
* [http://stackoverflow.com/questions/9071525/how-to-create-html-select-option-from-json-hash javascript - How to create HTML select option from JSON hash? - Stack Overflow]
* [http://stackoverflow.com/questions/9071525/how-to-create-html-select-option-from-json-hash javascript - How to create HTML select option from JSON hash? - Stack Overflow]
* [http://stackoverflow.com/questions/9895082/javascript-populate-drop-down-list-with-array JavaScript - populate drop down list with array - Stack Overflow]


== references ==
== references ==

Revision as of 10:15, 12 February 2013

Javascript approaches to do the same task

get the document by id

  • document.getElementById('abcId')
  • alternative: (1) Get the id attribute by using jQuery attr(): $("selector").attr("id");[1] (example) and (2) go to the first step
  • parallel naming rules for html elemnt tags ex: <input id='checkbox_id1' > & <select id="select_id1">

HTML select form Attribute

references