Using a ajax request I want to change content of my div.
<div id="d1">202</div>
So I want to change the content to a different number.
$('d1').InnerText???
Also, say I wanted to increment the number, how could I do that? Do I have to convert to int?
Best Solution
Check out the jQuery documentation.
If you wanted to increment the number, you would do
P.S. Not sure if it was a typo or not, but you need to include the
#
in your selector to let jQuery know you are looking for an element with an ID ofdi
. Maybe if you come from prototype you do not expect this, just letting you know.