if i run the same code for IE every thing is fine i am getting the value of selectedId where as for firefox and chrome it is giving values Undefine.
-------
In Chrome (sorry, I'm using a computer that doesn't have FF, and I'm not going to install it just for this question) it works if you use .getAttribute(). So:
// replace
e.selectedId;
// with
e.getAttribute("selectedId");
Or, in your function:
var id = e.getAttribute("selectedId");
console.log("the value of selected IDS="+id );
if (id != null)
{
value += ", "+id;
}
Also, note that JavaScript is case sensitive, so your variable value
is not the same as Value
, and you were saying Value =
where you probably meant value +=
. And you may want to use quotes around your element attributes: onclick="createSelected()"
.
Try reading the selectedId as below. Use getAttribute method
alert("the value of selected IDS="+e.getAttribute('selectedId'));