![]() |
Can not pass ID with dot(.) and (-) to javacript
Html code:
<input id="text.id" type="text" onFocus="dosomething(this,'text1.id')"> <input id="text1.id" type="text"> i am trying to do something like above, i'm trying to pass id(text1.id) with function dosomething() but its not working. please help me. :confused: |
use the _ not the dot, i dont think . is a legal name character..
text_id |
Thank you for your reply durangod. but can't change ID name. i have to go with text1.id.
any other suggestion??? |
Quote:
|
That id wouldn't work for anything else either - not just JavaScript.
In CSS #text.id would be looking for an element with id="text" and class="id" and wouldn't match the id you have. I can't think of why someone would want to target an input field but I doubt that <a href="text.id"> would link to that field properly either. That's all three possible uses for an id with at least two and probably all three of them not working when the id contains an illegal dot. |
thank you all for your valuable reply....
My work is done. :) |
Quote:
|
Quote:
|
| All times are GMT +1. The time now is 05:06 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.