Basic JavaScript/jQuery example for begginers

less than 1 minute read

JavaScript (JS) is a dynamic computer programming language. It is most commonly used as part of web browsers, whose implementations allow client-side scripts to interact with the user, control the browser, communicate asynchronously, and alter the document content that is displayed. It is also being used in server-side programming, game development and the creation of desktop and mobile applications.

This is a basic code example of how to make dissapear things in a web using JavaScript/jQuery. Just copy-paste it to the notepad, study it (trust me, is very simple) and run it in your browser.

<pre class="lang:xhtml decode:true crayon-selected">
<html lang="en">
<meta charset="utf-8">
<title>JavaScript Example</title>
<script src=""></script>

<style type="text/css">
background-color: DimGray;
color: white;}

$(document).ready(function() {
    $("#hide").click(function() {
    $("#show").click(function() {


<button id="hide">HIDE TEXT</button>
<button id="show">SHOW TEXT</button>

<div id="div_to_hide">HI, IM THE MAGIC TEXT</div>