When I execute this code I get an error:Code:$(function() { $(".vote").click(function() { var id = $(this).attr("id"); var name = $(this).attr("name"); var parent = $(this); if(name=='up') { var idtrim = id.replace('-up',''); var dataString = 'id='+ idtrim ; var oppid = idtrim + '-down'; $(this).fadeIn(200).html('<img src="dot.gif" align="absmiddle">'); alert (dataString); $.ajax({ type: "POST", dataType: "json", url: "updown/up_vote.php", data: dataString, cache: false, success: function(data) { parent.html(data.upvalue); document.getElementById(oppid).innerHTML(data.downvalue); } }); }
TypeError: document.getElementById(...).innerHTML is not a function
[Break On This Error]
document.getElementById(oppid).innerHTML(data.downvalue);
I have tried setting a variable and then changing html (as in the parent.html line above my error:
which gives this error:Code:var opposite = document.getElementById(oppid); opposite.html(data.downvalue);
TypeError: opposite.html is not a function
[Break On This Error]
opposite.html(data.downvalue);
What am I doing wrong?
Thanks,


Reply With Quote
Bookmarks