Forums

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

HTML Macro - buttons wont display

Elliot Surovell
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!
March 17, 2023

I am trying to create a counter on a page that can increment and decrement by pressing a button. I wrote this HTML code:

 

<!DOCTYPE html>
<html>
<head>
<title>Space Clicker</title>
</head>

<body>
<script type="text/javascript">

var clicks = 0;
function addIncrement() {
clicks += 1;
document.getElementById("clicks").innerHTML = clicks;

};
var clicks = 0;
function subtractIncrement() {
clicks -= 1;
document.getElementById("clicks").innerHTML = clicks;

};
</script>
<button type="button" id="buttonId" onclick="addIncrement()">+</button>
<button type="button" id="buttonId" onclick="subtractIncrement()">-</button>

<p>Clicks: <a id="clicks">0</a></p>

</body>
</html>

 

When I run the HTML on an HTML editor, it works exactly as intended, but when I try to run it in the HTML macro, the "+" and "-" buttons display as plain text. How do I fix this?

1 answer

1 vote
Elliot Surovell
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!
March 17, 2023

Okay just figured it out, it was because of the sanitize option

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events