In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
In this issue, the editor will bring you about the three ways of JavaScript to achieve JS pop-up window. The article is rich in content and analyzes and describes for you from a professional point of view. I hope you can get something after reading this article.
I. Preface
The study of html and css has been roughly completed, and we have entered an important stage of JavaScript learning.
What is JavaScript and what is the use?
Javascript is a scripting language that runs on browsers. JS for short.
His appearance makes the original static page move, more vivid.
Third, the way in which HTML is embedded in JavaScript: the first way:
1. Functions to be realized:
The user clicks the button below to pop up the message box.
2. Pop-up window
JS is an event-driven programming language that relies on events to drive, and then executes the corresponding program. There are many events in JS, one of which is called: mouse click, word: click. And any event corresponds to an event handle called onclick. [note: the difference between an event and an event handle is that an event handle adds an on before the event word. And the event handle exists as an attribute of the HTML tag
3. What is the implementation principle of "nclick=js code"?
When the page opens, the js code does not execute, just registers the ss code with the button's click event. After the click event occurs on this button, the js code registered after the onclick will be automatically invoked by the browser.
4. How to use JS code to pop up a message box?
In JS there is a built-in object called window, all lowercase, can be used directly, window represents the browser object. The window object has a function called: alert, which is used by: window.alert ("message"); so you can pop up the window.
5 、 window. Can be omitted
The following two are equivalent
6. Multiple alert can pop up all the time.
Strings in JS can use either double or single quotation marks. You can use the semicolon ";" at the end of a statement in JS or not.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.