Whether it is getElementById or getElementsByTagName, when passing parameters, not all browsers must be case-sensitive, in order to prevent unnecessary errors and trouble, we must insist on a case-sensitive habit.First, get the node by tag name1, getElementsByTagName () method gets the node by the tag name, because the label name repeats, so it returns an array of objects htmlcollection (NodeList), which holds a list of all nodes of the same element n
DOCTYPE HTML>HTMLLang= "en">Head> MetaCharSet= "UTF-8"> title>title> style>ul{List-style:None;cursor:Pointer; } style>Head>Body>ulID= "UU"> Li>Library, you're in a hurry.Li> Li>Black oil for wiping the wavesLi> Li>In the search for death.Li> Li>Search GALi> Li>His big aunt.Li>ul>Scriptsrc= "Common.js">Script>Script> //Mouse entry and mouse leave two events //get the incoming Li tag varList=my$ ("UU"). getElem
A very simple use: Click on the menu to be able to display the following or not display.1, the main purpose: the show is a menu item, and then click, Hide, point, pop-up the following content
Using the Overflow:hidden and overflow= "visible" properties in the clicked Function, setting properties should
node.style.overflow= "visible"; it is also important to set the TR height so that other options are hidden
2, the use of the same technology , add a few, but is to pass the parameters of the tr
In web development, most of the Pull-down menus are on one line and up and down, which is good but lacks a hierarchy and the customer doesn't know the relationship between the options, so sometimes we need to display the dropdown in a tree structure in the Drop-down menu to give the customer a better experience. For example: Suppose there is a table in the database that stores information about China's provinces and cities, as follows:
This table is in accordance with the tree structure fea
This example describes the way JavaScript is closed and expanded through the overflow control list. Share to everyone for your reference. The implementation method is as follows:
The wants this article to help you with your JavaScript programming.
The examples in this article describe the way JavaScript implements the DOM dynamic vertical list menu of provinces and cities. Share to everyone for your reference. The implementation method is as follows:
The wants this article to help you with your JavaScript programming.
The examples in this article describe how JavaScript implements the sort of Drop-down list values. Share to everyone for your reference. Specifically as follows:
function Sortlist (ID) {
var obj = document.getElementById ("id");
var values = new Array ();
for (var i = 0; i
I hope this article will help you with your JavaScript programming.
Web Remote Process calling (webrpc) is a recent hot topic for calling remote methods without refreshing new pages. In some cases, he even becomes an irreplaceable implementation method. The implementation of webrpc has gone through reading from common URLs, hiding frames, IFRAME, XMLHTTP, and even flash. This article will list existing webrpc solutions (products) and make a simple evaluation.
The evaluation will be carried out in the following as
Javascript event list explanation
Event
Browser support
Explanation
General events
Onclick
Ie3, N2
This event is triggered when you click the mouse.
Ondblclick
Ie4, N4
This event is triggered when you double-click the mouse.
Onmousedown
Ie4, N4
Trigger this event when you press the mouse
Javascript event list explanation
Event
Browser support
Explanation
General events
Onclick
Ie3, N2
This event is triggered when you click the mouse.
Ondblclick
Ie4, N4
This event is triggered when you double-click the mouse.
Onmousedown
Ie4, N4
Trigger this event when you press the mouse
Onmouseup
Ie4, N4
This event is triggered w
Javascript is a drop-down list of provincial/municipal connections.Zookeeper
Object. options. add (new Option (label, value) method to add an option object to the Set;The object. options. remove (index) method removes the specified items in the options set;Object. options (index) or options. item (index) can be used to obtain the specified items in the options set through the index;The select tag a
(). Next (). Show ();text box showing the current line$ ("table"). Find (". X:eq (" + $i + ")"). Show ();Get quantityvar $shul =$ ("Span:eq (" + $i + ")"). text ();Hide Quantity to clear$ ("Span:eq (" + $i + ")"). Hide (). empty ();Assign a value to a text box$ (". X:eq (" + $i + ")"). Val (parseint ($shul));Click Confirm to pass the value of the text box to span display, switch the confirmation button to the Modify button$ (' input[value= ' confirmation "]"). Click (function () {$ ("input[valu
Functionbuildsel (Str,sel) {sel.options.length=0;var Arrstr=newarray (); arrstr=str.split (",");//split the string into array elements by commas if (str.length>0) { for (vari=0;iThank you for your guidance ~ Note the memoThis article from "Chronosphere" blog, reproduced please contact the author!JavaScript dynamically displays strings to a drop-down list
Getcurrentoptionvalue (index) {if (index >= 0) return Object (index). value; 5. Gets the display value of the currently selected option Labelfunction Getcurrentoptionlabel (index) {if (index >= 0) return Object (index). text; The following is the date linkage drop-down box: function YYYYMMDD () {//sets the set of months Monhead = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];//all contents of the purge year drop-down box, most notably The space var yobj = document.form1.yearoptionsClear (yob
One of the new features of HTML 4.0 is the ability to cause HTML events to trigger behavior in the browser, such as when a user clicks on an HTML element to start a JavaScript. The following is a list of attributes that you can insert into an HTML tag to define the behavior of the event.
Property
When this event occurs ...
Onabort
The image load was interrupted.
JavaScript drop-down list box with the current year and 50 years before and after, and the default selection is the current year
Copy Code code as follows:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.