user1523362
user1523362

Reputation: 129

Change HTML tag text JavaScript

I want to change the content of the below html div. Im using JQuery PhoneGap. I cant get it too work, any help would be great.

<div id="output"> This should change </div>
<script>
    $('#output').text('Changed with jQuery');
</script>

Upvotes: 0

Views: 322

Answers (3)

amit ghosh
amit ghosh

Reputation: 276

you should write like

$("#output").html('The content you like');

Upvotes: 1

11684
11684

Reputation: 7517

You could do this even without jQuery:

document.getElementById("output").innerHTML = "CHANGED!";

Upvotes: 4

colestrode
colestrode

Reputation: 10668

PhoneGap frequently used with jQuery, but they aren't the same thing. Make sure you have jQuery imported.

Upvotes: 1

Related Questions