In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces jquery how to judge whether there is a remainder of division, the article is very detailed, has a certain reference value, interested friends must read it!
The method to determine whether there is a remainder in jquery division: use the if statement, the "%" and "= =" operators to detect whether two numbers are divisible, that is, whether the remainder of the division is equal to 0, and the syntax is "if".
The operating environment of this tutorial: windows7 system, jquery1.10.0 version, Dell G3 computer.
1. Create a new html file, named test.html, to explain how jquery can determine whether it can be divisible or not. Use the input tag to create two numeric input boxes and set their id to num,num2, which is mainly used to obtain the input object through this id. Use the button tag to create a button named "divisible".
In the test.html file, bind the onclick click event to the button button, and execute the pan () function when the button is clicked.
2. In the js tag, create the pan () function. In the function, the input object is obtained through the id value of input, and the number of the input box is obtained by using the val () method.
In the pan () function, use the if statement to determine that num is divided by num2 by "%". If the division equals 0, the prompt "can be divisible", otherwise, the prompt "cannot be divisible".
Open the test.html file in the browser, enter a number in the text box, and click the button to see the effect of the implementation.
The above is all the contents of the article "how jquery judges whether there is a remainder in division or not". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
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.