HTML Script Tag In Hindi – What is a Scripting Language?

HTML

HTML <script> tag In Hindi – What is a Scripting Language in Hindi? – HTML Me Scripting Ek Small Program Hai Jiska Kaam Kisi Bhi Webpage Ko Dynamic Aur Interactive Banana Hai. Ye Ek Prakar Ki Client-Side Programming Hai Jiske Kuch Important Functions Neeche Btaye Gaye Hain:

  • Generate A Pop-Up Alert Box Message
  • Generate Drop-Down Menus
  • Image Manipulation
  • From Validation
  • Changing The Content Dynamically

Also Read – HTML Frames

HTML Script Tag In Hindi

Aaiye Ab Real Example Lekar Samjhte Hain, Neeche Ek Chota Sa Login Form Diya Gaya Hai Jisme Four Textfields Hain: Username, Email, Password aur Re-Enter Password.

Jaisa Ki Aap Dekh Pa Rahen Hain, Upar Diye Gaye Login Form Mein Sabhi Fields Mein Input Hai Lekin Username Field Khali Hai. Agar Aisi Condition Me “Register” Kiya Gaya Toh Message Display Hua Username is required. Iss Tarah Ki Form Validations aur Dynamic Interactions, Scripting Language Ki Wajah Se Hi Possible Hain.

What Are The Languages Used For Scripting In Hindi? –  HTML Mein Scripting Ke Liye JavaScript Aur VBScript Ka Istemal Kiya Ja Sakta Hai Lekin Mostly Web Developers JavaScript Ka Istemal Karte Hain Kyuki VBScript Ko Kuch Browers Support Nahi Karte.

How To Use JavaSript In HTML Document?HTML mein javascript ko 2 tareeke se istemal kiya ja sakta hai:

  • Internal Javascript/ embedded in the same file
  • External Javascript/ separate .js file

The HTML <script> Tag

Jaisa Ki Humne Upar Samjha, Javascript Ko Do Tareeke Se Istemal Kiya Ja Sakta Hai, Dono Mein Hi <script> Tag Istemal Hogi:

  • Internal JS Mein <script> Tag Ke Andar Hi Scripting Code Diya Jata Hai.
<script>
document.getElementById("demo").innerHTML = "Hello JavaScript!";
</script>
  • Extertal JS Mein Ek Separate Scripting File Create Ki Jati Hai .js Extension Se Aur Baad Me <script> Tag Ke src Attribute Me Uss File Ka Link Diya Jata Hai.
<script src = "/html/script.js" type = "text/javascript"/></script>

Aaiye Ab Dono Ka Ek-Ek Example Dekhte Hain:

Example 1: (Internal JavaScript)

<!DOCTYPE html>
<html>

   <head>
      <title>JavaScript Internal Script</title>
      <base href = "https://masterprograming.com/" />
      
      <script type = "text/JavaScript">
         function Hello() {
            alert("Hello, World");
         }
      </script>
   </head>

   <body>
      <input type = "button" onclick = "Hello();" name = "ok" value = "Click Me" />
   </body>

</html>

Output:

Explanation:

Upar diye gaye output me jab hum “Click Me” button par click krenge toh ek pop-up alert box message display hoga.

Example 2: (External JavaScript)

Jscript.js file

function Hello() {
   alert("Hello, World");
}

HTML file

<!DOCTYPE html>
<html>

   <head>
      <title>Javascript External Script</title>
      <script src = "/html/script.js" type = "text/javascript"/></script>
   </head>

   <body>
      <input type = "button" onclick = "Hello();" name = "ok" value = "Click Me" />
   </body>

</html>

Upar Diye Gaye Example Ko Khud Se Practice Karen Aur Output Check Karen.

Leave a Reply

Your email address will not be published. Required fields are marked *