HTML script tag attributes in hindi

html script tag attribute in hindi

Introduction

हेलो दोस्तों आज हम इस post में script tag के attribute के बारे में जानेगे!. script tag के attributes जैसे की src, type, async,defer, integrity है तो इन सभी attribute के बारे में detail के साथ समझेंगे!.

Script tag attributes

HTML में <script> tag का इस्तेमाल client-side javascript code को define करने के लिए किया जाता है!. HTML document में javascript की external file को include करने के लिए, <script> tag में कई attribute है जिनका इस्तेमाल अलग – अलग तरह की setting और behaviour specify करने के लिए किया जा सकता है!.

1. src: src attribute का इस्तेमाल external javascript file को HTML document में include करने के लिए किया जाता है!.

example:

<script src="script.js"></script>

ऊपर के example में देख सकते hai की javascript code को script.js में लिखा होगा और src के जरिये हम HTML document execute करा सकते है!.

2.type: type attribute किस प्रकार की script को represent कर रहे है वह indicates करती है!.

example:

<script src="script.js" type="text/javascript"></script>

 3. async: async एक boolean attribute specifies करती है की script को asynchronously रूप से execute किया जाना चाहिए!. इसका मतलब है की script load होने के दौरान  HTMl parsing और rendering continue रहेगा इसके पूरा होने की waiting किये बिना!.

example:

<script src="script.js" async></script>

4. defer: defer attribute बी एक boolean attribute है और script को HTML document को parse करने के बाद execute किया जाता है!. async attribute के विपरीत यह multiple script का execution का order को maintains बनाये रखता है!.

example:

<script src="script.js" defer></script>

 5. integrity: यह attribute script file’s content को cryptographic hash specifies कराती है!. इसका इस्तेमाल file की secourity और file को protecting करने के लिए किया जाता है!.
example:

<script src="script.js" integrity="sha384-qznGD0M7KdFu6HwLV1I/bOjIa9f0ZXgWVb4j/jXJD6mYq0i7F1AdBquOAGFSpb8U" crossorigin="anonymous"></script>

ये <script> tag की कुछ सामान्य तोर से इस्तेमाल की जाने वाले attribute है यद् रखे की आप HTML document में अपने javascript code के लिए desired behavior setup करने के लिए attribute को script tag में setup कर सकते है!.

Leave a Comment

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