Cum afișam un element HTML ascuns folosind jQuery?

Configurare noua (How To)

Situatie

Cu jQuery, puteți afișa elemente HTML ascuns cu metoda show():

Solutie

Pasi de urmat

 

<!DOCTYPE html>
<html>
<head>
<script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js”></script>
<script>
$(document).ready(function(){
$(“#afișează”).click(function(){
$(“p”).show();
});
});
</script>
</head>
<body>

<p style=”display:none”>Ai apăsat! Ai apăsat! Tu chiar ai apăsat butonul!</p>

<button id=”afișează”>Afișează</button>

</body>
</html>

 

Tip solutie

Permanent

Voteaza

(7 din 22 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?