I am using jQuery with the colorbox plugin. I want to change the text of a button w/ jquery. Following this example, jQuery change button text I added this line of code:
$(document).ready(function(){
$('#cboxClose').html('Hello World');
But the text of the button still says "Close"
Jfiddle shows that my code should work: http://jsfiddle.net/wTwXz/ -- but the console does not show any errors. Changing the code to .val("hello world")
or .text("hello world")
both don't work. Also, the HTML that shown in firebug shows that there is no other element with id=cboxclose
<!DOCTYPE html>
<html>
<head>
<body>
<div style="display:none">
<div id="cboxOverlay" style="opacity: 0.9; cursor: pointer; visibility: visible;"></div>
<div id="colorbox" class="" role="dialog" tabindex="-1" style="display: block; visibility: visible; top: 421px; left: 588px; position: absolute; width: 504px; height: 104px;">
<div id="cboxWrapper" style="height: 104px; width: 504px;">
<div>
<div style="clear: left;">
<div id="cboxMiddleLeft" style="float: left; height: 62px;"></div>
<div id="cboxContent" style="float: left; width: 462px; height: 62px;">
<div id="cboxLoadedContent" style="width: 462px; overflow: auto; height: 34px;">
<div id="cboxTitle" style="float: left; display: block;"></div>
<div id="cboxCurrent" style="float: left; display: none;"></div>
<button id="cboxPrevious" type="button" style="display: none;"></button>
<button id="cboxNext" type="button" style="display: none;"></button>
<button id="cboxSlideshow" style="display: none;"></button>
<div id="cboxLoadingOverlay" style="float: left; display: none;"></div>
<div id="cboxLoadingGraphic" style="float: left; display: none;"></div>
<button id="cboxClose" type="button">close</button>
</div>
<div id="cboxMiddleRight" style="float: left; height: 62px;"></div>
</div>
<div style="clear: left;">
</div>
<div style="position: absolute; width: 9999px; visibility: hidden; display: none;"></div>
</div>
</body>
</html>
What else can I try?