Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
146 views
in Technique[技术] by (71.8m points)

html - Click On javascript or iframe adsvertisement to show button?

I want to when users is click on a Javascript or iframe ads then a next button will show

how can I do it?

this is the advertisement code:

<div id="adm-container-15022"></div><script type="text/javascript" src="//moonads.net/display/items.php?15022&647&728&90&4&0&0"></script> ```
question from:https://stackoverflow.com/questions/65843404/click-on-javascript-or-iframe-adsvertisement-to-show-button

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I have added the javascript function that should be executed when a person clicks on the div by using onclick. Then I had added a button and made its display equal to none so as to hide it. In the function definition, I selected the button using document.querySelector and then modified its display to inline to make it visible.

<div id="adm-container-15022" onclick="showButton()"></div><script type="text/javascript" src="//moonads.net/display/items.php?15022&647&728&90&4&0&0"></script>

<button id="NextButton" style="display: none;">Next</button>
<script>
function showButton()  {
    document.querySelector("#NextButton").style.display = "inline";
}
</script>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...