Idea: Add the Click event → event to the Li object and use innerHTML to get Li's text. The example shows the following:
1, HTML structure
1 2 3 4 5 6
2. JavaScript code
1 2 3 4 5 6 7 8
Window.onload = function () {var obj_lis = document.getElementById ("Test"). getElementsByTagName ("Li"); for (i=0;i
css| Web page
Originally, I intend to write the article on the theme of this article, but recently in the Sina blog group to see this article, I do not have much effort, reproduced here, I hope to help.
Li {list-style-image:url (images/disc.gif);}
This style definition for Li is to use a picture for a list item instead of a small dot that is displayed. Of course, you can also display other effects, see the
Add a li and the text in the js code. li is added, and the text is not in it. nbsp; lt; script nbsp; type = "text/javascript" gt; nbsp; function nbsp; t1 () { nbsp; nbsp in js code, add a li and the text in it. li is added, and the text is not in it.
Function t1 (){
Var ce = document. createElement ('Lil
Array loops: Loops multiple li each Li fixed n data, Li
PHP Code:
$arr Array (1,2,3,4,5,6,7); $x = 1; $y = 0; foreach ($arras$k$v) { $data[$y$ V//4 is not an LI display 4 data, if the display 3, change to 3. If($x = = 4) {$y+ +; $x=1; Continue ; }
How to Use jquery to insert a new li element after any specified li element, jqueryli
How to Use jquery to insert a new li element after any specified li element:This section describes how to use jquery to insert a new li element to the end of any
$ (". Test Li"). Click (function () {$ (". Test Li a"). Removeclass ("test01");$ (". Test Li a"). AddClass ("test02");$ ("a", this). Removeclass ("test02");//a tag in the current Li$ ("a", this). AddClass ("test01");var Title_index = $ (this). index ();//Current Li's indexAll of the IMG in Livar allimg = $ (". Test
Js loops bind events to li implementation click li to bring up its index value and content recently, we will always encounter this interview question:
There are many different answers on the Internet, but I still want to repeat them. As the saying goes: Good memory is not as bad as a pen. Although it is common, simple, and repeated, in short, the simple multi-write memory is still profound. Even if you for
In the near future, we always encounter such an interview question:Now online answer a lot of agree, but I still want to repeat the story again, as the saying goes: good memory is not as bad as the written, although common, simple, recurring, in short, in a simple more write memory or very deep, even if forget, can also take out to turn over.The code is as follows: (simpler)HTML codeMethod One:var Itemli = document.getelementsbytagname ("Li");for (var
First we need an HTML structure
We go through all of the UL under the Li and add click events, generally we will add the click event in the For loop, but the result is not the same as we expect, then is why???
Next, look at our JS code.
var li = document.getelementsbytagname (' li ');
for (var i = 0;i
We've achieved!!!.
This is the ef
In the typical js issue, click li to bring up the current li index and innerHTML functions.In the typical js issue, click li to bring up the current li index and innerHTML functions.
If you click one of them, alert is required to output the following results:
According to our general idea, the code should be written
The line feed is displayed when the li element is floating on the right, and the line feed is floating on the li element.
The line feed will appear when the li element is right floating:In general, if you want to display block-level elements in one row, you can apply a floating value to the elements, but sometimes it is not as expected, and a line break may occu
Ask for Enlighten
Outputs an element in the array that is a multiple of 5 to the drop-down menu
Place the elements in the array in the
Label, odd and even Li backgrounds are differentFind the elements in the array as numbersReply to discussion (solution)
". $item." ":" ");}); echo "$option";//Put the elements in the arrayLabel, the odd and even Li background is different $i = 0; $
Without changing the company's business direction and products, how can employees change their way of doing things?
Text/Li Shanyou
When a company's original mainstream business and mainstream market are becoming increasingly mature, it is typical to face the pain arising from new business and new market transformation. Therefore, Li Yanhong's demand for changing the way employees think and promoting the cr
The complete implementation method of jQuery Old Huang Li and jquery Old Huang Li
The example in this article describes how to implement jQuery's old calendar. Share it with you for your reference. The implementation method is analyzed as follows:
Let's take a look at the program running effect:
The html page is as follows:
Copy codeThe Code is as follows:Programmer's old experience
The style.css style is
The title may be a bit of a li,li, but it's actually two columns in the second column. So it looks like it's 4 columns. Had to write this title. But you want to see the effect you will know, I believe many people have used such a layout. This effect is good with table, with Li to achieve the difficulty lies in Li's width control, too wide will go back, too narrow
Lt; tr gt; lt; td gt; test lt; td gt; lt; tr gt; replace it with lt; LI gt; test lt; LI gt; for PHP regular expression Replacement. thank you. Example:
TestTo replace
TestPlease replace the PHP regular expression. thank you.
Because my HTML code is as follows:
News 1
2014-03-12
News 2
2014-02-20
In fact, we just in the QQ dynamic and then into a friend dynamic can see an ad, click Li yu qq space live ads can be entered to the appointment address.
1, we open "mobile phone QQ" in mobile phone-"friend dynamic" effect as shown in the following image:
2, then enter into the interface we click on "Dynamic Top"-"Li Yuchun Live poster" open entry effect is as follows:
3, the last can en
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.