Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
when i click the button every thing is closed, why it is happening?
#1
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>
Reply
#2
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
Reply
#3
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.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply




Users browsing this thread: 1 Guest(s)