Basic JavaScript/jQuery example for begginers

- 1 min 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.

Basic JavaScript/jQuery example for begginers

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.

<html lang="en">
    <meta charset="utf-8">
    <title>JavaScript Example</title>
    <script src=""></script>

        #div_to_hide {
            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>


Share: Link copied to clipboard


Previous: .htaccess basic configuration
Next: Europa Necesita Controlar la Inmigración

Where: Home > Technical > Basic JavaScript/jQuery example for begginers