| Author |
How to retreive value attribute of the html:option tag
|
Shyam kumar
Ranch Hand
Joined: May 21, 2006
Posts: 146
|
|
I have the following select tag: <html:select property="college" onchange="populateCourse();" > <html ption value="IPU" >IP University</html ption> <html ption value="DU">Delhi University</html ption> <html ption value="GJU">GJU</html ption> </html:select> I want to retreive the attribute value of <html ption> tag in populateCourse() javascript. The statement document.getElementById("college").selectedIndex is giving me integer index whereas document.getElementById("college").value is giving me the display value like IP University instead of attribute value IPU How can i do this?
|
 |
jeff rusty
Ranch Hand
Joined: Nov 07, 2006
Posts: 109
|
|
Naveen , can you post the code which you have written in the javascript function populateCourse()and "document.getElementById("college").value" will return only the attribute value and not the text in <html ption> or in normal <option> unless you have tried to retrieve the text like this "document.getElementById("college").options[0].text". [ December 03, 2006: Message edited by: prem kamal ]
|
 |
 |
|
|
subject: How to retreive value attribute of the html:option tag
|
|
|