I'm looking for Javascript that will fire when page opens and sets Image1 visibility to true.
Thank开发者_开发知识库s
If you are referencing the CSS visibility
property:
window.onload = function() {
document.getElementById( 'Image1' ).style.visibility = "visible";`
};
or the display
property:
window.onload = function() {
document.getElementById( 'Image1' ).style.display = "block";
};
If you want it to occur right away utilize the document.onload method. I.e.
document.onload = loadFunc;
function loadFunc() {
document.getElementById( 'Image1' ).style.display = "block";
}
<script>
window.onload = function() {
document.getElementById("Image1").visibility = "visible";
}
</script>
精彩评论