Brand Logo

Website Coding Portal
HTML CSS & Script

Sawami Vivekanand
code
Alert Function

✯ जावा स्क्रिप्ट में अलर्ट फंक्शन की मदद से हम यूजर को ऑनस्क्रीन कोई संदेश दिखा सकते हैं । ये संदेश यूजर के द्वारा किसी ऑब्जेक्ट पर क्लिक करने पर प्रदर्शित हो सकता है या फिर किसी अन्य परिस्थिति में प्रदर्शित करवाया जा सकता हैं ।

With the help of alert function in java script we can show any message onscreen to the user. This message can be displayed when the user clicks on an object or can be displayed under any other circumstances.

✯ अलर्ट बॉक्स का इस्तेमाल दो तरीको से किया जा सकता है जिसके तहत कोई अलर्ट बॉक्स या तो वेबसाइट के खुलने पर स्क्रीन पर रिफ्लेक्ट करवाया जाता हैं या फिर किसी एचटीएमएल टैग के साथ किसी विशेष गतिविधि के किये जाने पर प्रदर्शित करवाया जाता हैं ।

Alert boxes can be used in two ways, under which an alert box is either reflected on the screen when a website is opened or displayed when a specific action is performed with an HTML tag.

✯ यहाँ पर एचटीएमएल के टेग में लिखी गयी जानकारी पर क्लिक करने पर प्रदर्शित होने वाले जावा स्क्रिप्ट अलर्ट बॉक्स के बारे में समझाया गया हैं । एचटीएमएल के किसी भी टैग के स्टार्टिंग हिस्से में जावास्क्रिप्ट के बेहेवियर प्रकार के साथ में अलर्ट फंक्शन को लिख कर इस गतिविधि को पूर्ण किया जा सकता हैं ।

Here the JavaScript alert box displayed on clicking the information written in the HTML tag has been explained. This activity can be accomplished by writing an alert function with a JavaScript behavior type in the starting part of any HTML tag.

✧ alert() Function Structure ✧

✧ परिणाम ✧

onclick="show()" क्या है ?

✯ यहाँ onclick का अर्थ है कि इस एचटीएमएल टैग में लिखी हुई सामग्री पर क्लिक करने पर जावा स्क्रिप्ट का "show()" फंक्शन अपना कार्य करना आरम्भ कर देगा । show() वैल्यू के स्थान पर आप अपनी इच्छा से फंक्शन का नाम कुछ भी रख सकते हैं ।

Here onclick means that on clicking the content written in this HTML tag the "show()" function of java script will start working. In place of show() value, you can name the function anything you want.

function show() {} क्या है ?

✯ स्क्रिप्ट टैग में हमें उस फंक्शन की गतिविधि को परिभाषित करना होता हैं जिस फंक्शन को हमने एचटीएमएल टैग में बनाया हैं अर्थातः show() फंक्शन । h1 टैग की सामग्री पर क्लिक करने पर अलर्ट बॉक्स तभी प्रदर्शित होगा जब हम स्क्रिप्ट टैग के अंदर show() फंक्शन में अलर्ट बॉक्स को निर्दिष्ट करेंगे ।

In script tag we have to define the function which we have created in html tag ie: show() function. On clicking the content of h1 tag the alert box will be displayed only if we specify the alert box in the show() function inside the script tag.

alert(); क्या है ?

✯ अलर्ट जावा स्क्रिप्ट लैंग्वेज का एक फंक्शन हैं जिसको लिखने के लिए alert(" "); प्रारूप का प्रयोग किया जाता हैं तथा हमारे द्वारा " " (डबल कोट) में लिखी गयी जानकारी उपयोगकर्ता को संदेश के रूप में निर्दिष्ट फंक्शन के टैग कंटेंट पर क्लिक करने के पश्चात स्क्रीन पर रिफ्लेक्ट हो जाती हैं ।

Alert is a function of the Java Script language, to write alert(" "); format is used and the information written by us in " " (double quote) gets reflected on the screen as a message to the user after clicking on the tag content of the specified function.