Hello,
I'm trying to create an application where I can extract information from a page and put it into Excel.
Now the problem is that the page has been constructed using jQuery and Ajax.
So when you select an option in a select-box, the contents change.
Now the problem is that when I select the option using a script, the contents don't change.
So manually select changes the content, script select doesn't change the content.
Is there a way I can trigger the onChange event of an element to let it know it has been changed?
Thanks,
Cainnech
I'm trying to create an application where I can extract information from a page and put it into Excel.
Now the problem is that the page has been constructed using jQuery and Ajax.
So when you select an option in a select-box, the contents change.
Now the problem is that when I select the option using a script, the contents don't change.
So manually select changes the content, script select doesn't change the content.
Is there a way I can trigger the onChange event of an element to let it know it has been changed?
Code:
<html>
<head>
<title></title>
<script type="text/javascript">
function selectvalue()
{
document.getElementById("dropdown").selectedIndex=4;
}
function changed()
{
alert("The contents have changed")
}
</script>
</head>
<body>
<select id="dropdown" onchange="changed();">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
<input type="button" value=" Select Value 3 " onclick="selectvalue()">
</body>
</html>
Cainnech
Comment