- Introduction to innerText in JavaScript in Hindi
- Javascript innerText Example in Hindi

Contents
show
Introduction to innerText in JavaScript
InnerText संपत्ति एचटीएमएल दस्तावेज़ पर dynamic टेक्स्ट लिखने के लिए इस्तेमाल किया जा सकता। यहाँ, टेक्स्ट की व्याख्या html टेक्स्ट के रूप में नहीं बल्कि एक सामान्य टेक्स्ट के रूप में की जाएगी।
इसका उपयोग ज्यादातर वेब पेजों में डायनामिक कंटेंट को जेनरेट करने के लिए किया जाता है जैसे कि वेलिडेशन मैसेज लिखना, पासवर्ड स्ट्रेंथ आदि।
जावास्क्रिप्ट इनरटेक्स्ट उदाहरण
इस उदाहरण में, हम key press के बाद पासवर्ड की strength प्रदर्शित करने जा रहे हैं।
<script type="text/javascript" >
function validate() {
var msg;
if(document.myForm.userPass.value.length>5){
msg="good";
}
else{
msg="poor";
}
document.getElementById('mylocation').innerText=msg;
}
</script>
<form name="myForm">
<input type="password" value="" name="userPass" onkeyup="validate()">
Strength:<span id="mylocation">no strength</span>
</form>