GetSimple Support Forum

Full Version: when i click the button every thing is closed, why it is happening?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
on my site when i click the hidden costum area button everything is closed.

i dont want to close them when i click this button. but they are closed.

what sould i do for it.


<!DOCTYPE html>
<html>
<head>
<style>
p { background:red; }
</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<p>

It is a long established fact that a reader will be distracted. The point of using Lorem Content is here...

</p>
<p>
<span>Mr [Name], [Surname]</span>
<a href="http://www.mobilyala.com" />

</a>
Welcome to our website. You can read all about our services. We are working on dekorasyon

<button>Hidden Custom Area</button>

</p>
<script>
$("button").click(function () {
$("p").empty();
});
</script>

</body>
</html>
The button seems to be deleting itself
Didn't get exactly what you mean. Perhaps you mean this?
Have no opportunity to check it right now. Does this help?

<!DOCTYPE html>
<html>
<head>
<style>
p { background:red; }
p.magicparagraph {background-color:teal;}
</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<p>

It is a long established fact that a reader will be distracted. The point of using Lorem Content is here...

</p>
<p>
<span>Mr [Name], [Surname]</span>
<a href="http://www.mobilyala.com" />

</a>
Welcome to our website. You can read all about our services. We are working on dekorasyon

</p>
<p class="magicparagraph"> This magic text will disappear if you dare to click the button dude</p>
<p> <button>Hidden Custom Area</button></p>




<script>
$("button").click(function () {
$(".magicparagraph").empty();
});
</script>

</body>
</html>


Cheers
Code:
$("p").empty();

Means to empty everything in a paragraph p tag.
This is jquery, you can google how to use jquery selectors to learn how it works.