“Como esconder todos os parágrafos em jQuery” Respostas de código

Como esconder todos os parágrafos em jQuery

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("button").click(function(){
    $("p").hide();
  });
});
</script>
</head>
<body>

<h2>This is a heading</h2>

<p>This is a paragraph.</p>
<p>This is another paragraph.</p>

<button>Click me to hide paragraphs</button>

</body>
</html>
kellbie

mostre hide mais text jQuery

<span id="text">Extra Text</span>
<span id="more">show more...</span>
<span id="less">show less...</span>

<script>
 $("#text").hide();
 $("#less").hide();
 $("#more").click( function() {
   $("#text").show();
   $("#less").show();
   $("#more").hide();
 });
 $("#less").click( function() {
   $("#text").hide();
   $("#less").hide();
   $("#more").show();
 });
</script>
Hilarious Hamerkop

Respostas semelhantes a “Como esconder todos os parágrafos em jQuery”

Perguntas semelhantes a “Como esconder todos os parágrafos em jQuery”

Mais respostas relacionadas para “Como esconder todos os parágrafos em jQuery” em JavaScript

Procure respostas de código populares por idioma

Procurar outros idiomas de código