I have a div that’s loaded dynamically
<div id="box"></div>
I’m trying to grab the div using jQuery and add text to it
$("#box").text("Hello World");
But I’m unable to do so. A delegation issue I assume. Any solutions?
I have a div that’s loaded dynamically
<div id="box"></div>
I’m trying to grab the div using jQuery and add text to it
$("#box").text("Hello World");
But I’m unable to do so. A delegation issue I assume. Any solutions?
2
Answers
Update Solution
I was loading the
<div>
using the jQueryload()
method. I decided to place the$("#box").text("Hello World");
in the callback function and it workedThe example below works like a charm