Hey folks. Out of necessity (and against web standards, I know) I must have two div with the same ID on one page. I'm trying to dynamically update a database with Ajax and update this div with that info. But when i go to update the second divd (with the same ID) it changes the first. Any way I can target the specific div with some sort of child/parent/this code? Mucho appreciated. Code below:
The div I'm trying to change is called "origassigned".
<script type="text/javascript">
function updateAssigned(str)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("origassigned").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","ajax_php/assigned.php?assigned="+str,true);
xmlhttp.send();
}
</script>