javascript - Grab html element value -
how can grab html element value using php or javascript? tried using jquery dom ready event, problem value wanna grab dynamically loaded somewhere, , when use jquery dom ready event of times happens dom ready value of element empty (its still not loaded) , when grab value jquery gives empty value of element, because grabbing before loaded in element.
how can grab value after loaded? there kind of trigger or event?
any / ideas appreciated !
the accepted solution works, think better :
<script type="text/javascript"> var bool = false; jquery('.element').bind('domnodeinserted', function() { if(bool == false) { alert("dom node inserted !"); bool = true; } }); </script>
try using window.load below:
$( window ).load(function() { // run code });
this guarantee page loaded first
further comment. can't assign load event single element that. need wait elements loaded(whole page) if want use window.load event. however, suggest :
function checkstatus() { var check = $(#yourelement name) if (check == null) { //change time whatever settimeout("checkstatus()", 100); } else { ... } }
in case wait time until element loads should enough set , can manipulate like. , lastly, please accept answer if works you.
Comments
Post a Comment