In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
If sentence example analysis, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
All events contain three elements of the js event:
1, the event source (that is, the tag or element that triggers the event)
2, event name (name of response event)
3. Analyze the response of the event
In this case, it is obvious that the p tag is the event source that triggers the event, onclick is the event name, and the response triggered is not fixed.
That is, it will correspond to different events according to different conditions. So, of course, we need to add a condition, and the specific usage is:
If (condition) {
/ / do something
}
Code:
/ / html part
Input method
to write
Pinyin
Close
/ / js part
Var oul=document.getElementById ("uul")
Function ou () {
If (oul.style.display== "block") {
/ / pay special attention to the equal sign above to judge whether it is equal or not, and the equal sign below is an assignment
Oul.style.display= "none"
} else {
Oul.style.display= "block"
}
}
After reading the above, have you mastered the method of example analysis of if statements? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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.