Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Simple show content con jQuery
<button class="btn btn-danger" id="click_desc">
Ver Más
</button>
<section id="desc">
<h1>hide content</h1>
</section>
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
<script>
$(document).ready(function() {
$("button").click(function() {
if ($(this).text() === 'Ver Menos') {
$(this).text('Ver Más');
} else {
$(this).text('Ver Menos');
}
});
$("#click_desc").click(function() {
$("#desc").toggle("slow", function() {
// Animation complete.
});
});
//end desc
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment