JavaScript code: dynamically display the current date and time on the webpage

& Lt; html & gt; & lt; head & gt; & lt; title & gt; dynamically display the current date and time on the webpage & lt;/title & gt; & lt;/head & gt; & lt; bodyonload & quot; showTime () & quot; & gt; & lt; scriptlanguage & quot; JavaScript & quot ;&

Insert content at the cursor using JS in textarea

01 // insert string 02 // myField text box object 03 // myValue 04 functioninsertAtCursor (myField, myValue) 05 {06 // IEsupport07if (document. selection) 08 {09myField. focu... 01 // Insert a string at the cursor 02 // MyField text box object 03 //

Insert text in the editing box and TextArea cursor using Javascript. Continuous insertion is supported.

001 & lt; html & gt; 002003 & lt; head & gt; 004005 & lt; title & gt; Testofinsertingcharactersatcursorposition & lt;/title & gt; 006007 & lt; scripttype & quot; text/javascript & quot; src & qu 001 002   003 004   005 Test of inserting

Js local printing

Because we need to use this item, we are very shameless to pick up people and collect it in our blog ~ & Lt ;! DOCTYPEhtml & gt; & lt; html & gt; & lt; head & gt; & lt; metahttp-equiv & quot; Content-Type & quot; content & quot; charsetutf-8 & quot;/

JQuery prevents page bounce

Sometimes we need to prevent the page with the backspace key from moving back. Generally, it is best not to use this function because it is not good for UX. Below are Js fragments tested in IE9 and Firebox10.0.2: $ (document). keydown (function (e) {

Js gets the current url, javascript gets the current page url value, and js gets the Domain Name

If you get the current domain name hostwindow. location. host; urldocument. domain; urlwindow. location. href; obtain the complete url path: Use the following code to complete the verification result: & lt; tablewidth100 %

What can DOM do? (1)

Hide and show hide the button above the section to control the display and disappearance of the Section. This special effect is achieved through JavaScript and HTMLDOM. The Code is as follows: JavaScript code: & lt; scripttype & quot;

Use javascriptDOM to add and delete multiple attachments

& Lt ;! DOCTYPEhtmlPUBLIC & quot;-// W3C // DTDXHTML1.0Transitional // EN & quot; http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  Use the DOM method to upload multiple attachments to the client

What can DOM do? (2)

Using getElementById () and getElementsByTagName () together, sometimes we may not want to select all paragraphs in the webpage, but the paragraphs (or other elements) of a specific part ). In fact, we can use the above two functions for

What can DOM do? (3)

DOM node information each DOM node stores some information about this node. Let's see how to access this information. Similar to nodeName, nodeValue, and nodeType, nodeName indicates the node name, nodeValue indicates the node value, and nodeType

Write simple tabs with js and add automatic switch Effect

Previous: Workshop. (Set an identification number to 0, write a few seconds to identify + 1, the execution of the switching effect of the function, however... SyntaxHighlighte previous: http://www.2cto.com/kf/201203/121796.html) Next, this article

DOM case ---- ultra-simple implementation of floating advertisements

Not to mention nonsense. Directly post code and add comments, which can be used anywhere. It is convenient and open-source. If you do not know anything, please leave a message .. & Lt ;! DOCTYPEhtmlPUBLIC & quot;-// W3C // DTDXHTML1.0Transitional //

Js star score details

Many websites have such a star scoring effect. Today, we will look at how js can be used to achieve the scoring effect. Effect description 1. When the mouse moves up, the stars light up and the text below is displayed. When the mouse moves out, the

JS paging batch printing solution (only supports IE)

1 & lt; html & gt; 2 & lt; title & gt; JS paging batch printing solution (IE only) & lt;/title & gt; 3 & lt; scriptlanguage & quot; javascript & quot; & gt; 4 functionprintWithAlert () {5document. all. webBrowser. exec 1 2 JS paging batch printing

Solution for creating ActiveXObject ("WScript. Shell") objects in Javascript

1. Go to the c:/WINDOWS/system32 directory and re-register shell32.dll and WSHom. ocx, scrrun. dll2 and restart the computer. Note: The registration operation can be performed directly at start-Run. Run the following statement

Simple Jquery Mask Layer

Css Code # brg {width: 100%; height: 100%; background: #333; position: absolute; top: 0; left: 0; filter: alpha (opacity60 ); -moz-opacity: 0.6, opacity: 0.6, position: absolute, top: 0, lef Css code # Brg{Width: 100%;Height: 100%;Background:

Simple Web Digital Clock

Let's first come to a final implementation: the main implementation idea is to use the JavaScript built-in object Date to get the current system time, and use the DOM method setInterval (code, time) to achieve real-time refresh. 1. simple Html page 1

How does js compare the two time sizes?

First, describe the usage of & quot; dateObject. setFullYear (year, month, day) & quot;: it is mainly used to set the year and returns the millisecond of the adjusted date. If there are two input boxes, you need to enter the time, from when to when (

Javascript banner replacement

& Lt ;! DOCTYPEhtmlPUBLIC & quot;-// W3C // DTDXHTML1.0Transitional // EN & quot; http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  Untitled document

Use UglifyJS to merge/compress JavaScript

In the Getting Started with UglifyJS, we mainly recorded the installation and configuration of UglifyJS. At the end of this article, a simple command is used in the command line to compress a JS file. This article compresses JS files

Total Pages: 5378 1 .... 3903 3904 3905 3906 3907 .... 5378 Go to: GO

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.