Hi All,
I need to fetch a document-element but i do not know the full Id of the element.
I only know part of the id of the element. Is it possible to get something like “Give me the element which has id starting with XXXXX”.
Say we have 3 elements
1)<input type=”text” id=”My_name_is_ABC value=”textboxval”>
2)<input type=”text” id=”My_name_is_BEF value=”textboxval”>
3)<input type=”text” id=”My_name_is_YEX value=”textboxval”>
now , in my script i have only “My_name_is_A” and i want to get a reference of an object whose id starts with “My_name_is_A”.
Is it possible to do so ?
Can i use something like
var regularExp = new RegExp(“My_name_is_A”);
document.getElementById(regularExp);
Of course the above does not work ?