javascript - Setting text for external HTML file -
i trying set text div located in external html file, when give id of div, not recognized, should do? load external html file this:
$('#header').load("resources/html/header.html");
then try set "headertitle" inside header.html
$('#headertitle').text($('#buidlingcombobox :selected').text());
if give id inside main html file, works fine.
you have wait until content available, , load()
has handy callback :
$('#header').load("resources/html/header.html", function() { $('#headertitle').text( $('#buidlingcombobox').val() ); });
Comments
Post a Comment