Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Why is my javascript rendering correctly in preview mode but stops working once the page is saved?

CAMG Training
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 19, 2015

My code is as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>IMG EXPAND</title>

<style type="text/css">
#ToggleTarget {
	display: none;
}
</style>

<script type="text/javascript">
function Toggle() {
	var el = document.getElementById("ToggleTarget");
	if (el.style.display == "block") {
		el.style.display = "none";
	}
	else {
		el.style.display = "block";
	}
}
</script>
</head>

<body>

<p><a href="javascript:Toggle();"><img src="https://thegrid.solarcity.com/download/attachments/37202190/warehouse.jpg?version=5&modificationDate=1447954817206&api=v2"/></a></p>

<div id="ToggleTarget">OMG YES<br />I DID IT I IS SO SMART</div>

</body>
</html>

1 answer

0 votes
Deleted user November 19, 2015

How does it look like? What does the browser logs say? Any errors?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events