I have made list:
<ul>
<li id="one"></li>
</ul>
And then in jQuery I do:
$("#one").text("one");
However it is not changing, also I have tried using .val()
but it didn't help.
Why it happens and how to change the li text?
I have made list:
<ul>
<li id="one"></li>
</ul>
And then in jQuery I do:
$("#one").text("one");
However it is not changing, also I have tried using .val()
but it didn't help.
Why it happens and how to change the li text?
There may be one of the problem you have
1) You did not imported js files properly
2)You might not write the code in ready function
Write your code in ready function and import jQuery related js files.
$( document ).ready(function() {
$("#one").text("one");
});
© 2022 - 2024 — McMap. All rights reserved.
$("#one").text("one")
should work. See your browser console for errors – Truett