I have the following function from that I am setting an attribute of select tag which have sortBy id but its not working from this function i have given alert in this function after setting attribute but its giving null value.
Please Help Me.
function getXmlByPrice(mi,mx)
{
if(mi!="" && mx!="")
{
$("#min").text(mi);
$("#max").text(mx);
$("#sortBy").attr('onchange','getDataFromXmlByStar();');
alert($("#sortBy").attr('onchange'));
getDataFromXmlByStar();
}
else
{
getXml();
}
}
if you are trying to add an
onchangehandler, instead ofdo this: