How to filter HTML tags and spaces in js

Copy codeThe Code is as follows:Function setContent (str ){Str = str. replace (/] *>/G, ''); // remove HTML tagsStr. value = str. replace (/[|] * \ n/g, '\ n'); // remove the trailing blank line// Str = str. replace (/\ n [\ s |] * \ r/g, '\ n'); //

JS timed window close instance

Copy codeThe Code is as follows:

Javascript cascade drop-down list instance code (self-write)

Html dom refers to some dom operations supported by various browsers before w3c standards emerge.1. Select object.AttributeA, selectedIndex: subscript of the selected option. The subscript starts from 0.B, length: Get or set the number of optionsC,

Jquery returns the regular expression of a number in a string.

Core code:Copy codeThe Code is as follows:Var paddleft = $ (". teacher-title" ).css ("padding-left"). replace (/[^ 0-9]/ig ,"");Var num = parseInt (paddleft );DEMO code: jquery get page styles Look At It [Ctrl + A select all Note: If you

JavaScript Event Learning Chapter 2 Event browser compatibility

The events proposed here, when they happen on a fixed HTML element, their names can be recognized by most browsers. That is to say, the browser will find the event handler script you have registered for this HTML element, and it will be executed

Javascript achieves the free drop of squares

You can try to press the left mouse button and drag a square to release it. Simple xhtml page [Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]

Differences between visibility and display in JAVASCRIPT style

When visibility is set to "den", although the element is hidden, it still occupies its original position.---------------------------------------------------------------Example:Copy codeThe Code is as follows: the first line of text triggers the

Js + vml create 3D page effect code

rotate left pause rotation right rotation [Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]

Navigator browser object in JavaScript

The navigator browser object that contains the version information of the currently used Navigator. Displays information about the browser currently used. When the JavaScript client is running, the engine automatically creates a navigator object.For

Screen objects in JavaScript

This is a basic JavaScript Screen Object.The screen Object reflects the screen settings of the current user.Width returns the screen width (number of rows ).Height returns the screen height.AvailWidth returns the available width of the screen

Self-built jquery plug-in to automatically add and delete rows

As shown in the following figure. For the demo address, click Since it is a plug-in, you should be able to use jquery like $ ("div"). method ({}) to call it. Its approach is: Copy codeThe Code is as follows: (Function ($ ){ }) (JQuery );

Word Count statistics in the input box-onpropertychange and oninput usage

Events that are convenient to implement this function are displayed on the Internet:Onpropertychange in IEOninput in non-IEThe advantage of using these two events is that when the content in the input box changes, the events related to using the key

Use jQuery to perform Cookies

When you browse a website, a very small text file will be generated on your hard disk, which can record your user ID, password, browsed webpage, stay time, and other information. When you come to this website again, the website can read Cookies and

Introduction to hexadecimal characters in JavaScript

Some time ago, I finally found a little introduction to JavaScript advanced programming:\ Xnn represents a character in hexadecimal code nn (n: 0-F)\ Unnn represents a Unicode Character in hexadecimal code (n: 0-F)Today, we need to know the

Introduction to this binding in Javascript

The specific value of this depends on the call mode.* Method call mode: this is bound to this object.* Function call mode: this is bound to a global object. A webpage is bound to a window.* Constructor call mode: this is bound to the newly generated

This points to a problem after JavaScript call apply binds a JavaScript object to a DOM event.

Let's take a look at the phenomenon:Copy codeThe Code is as follows: apply_and_call When you click DIV, the pop-up box displays undefined.The reason is that after the DOM object responds to the click event, the this keyword in the event method

Encapsulates a js image rotation function.

If you have any questions or have better comments or suggestions, you can leave a message at the end of the page. Thank you very much.The specific code is as follows:Copy codeThe Code is as follows: image rotation effect 1 2 3 4 5

Test code for dynamically Creating Style sheets in various browsers

Copy codeThe Code is as follows: xxx For standard browsers, you can directly use css. innerHTML to modify the css rules of HTMLStyleElement;However, IE may cause an "unknow runtime error ".

Jquer-ajaxQueue simple implementation code

There is nothing complicated, that is, using an array object as a queue to maintain the order of ajax requests. The following code is provided:Copy codeThe Code is as follows:; (Function ($ ){$. AjaxQueue = {// Manage the queue of ajax

Jquery code for processing multiple ajax requests at a time

Copy codeThe Code is as follows:$ (Document). ready (function (){$ ('# Getsetgo'). click (function (){$. When ($. ajax ("page1.php"), $. ajax ("page2.php"). done (function (a1, a2 ){Certificate ('incluid1'0000.html (a1 [0]);Certificate

Total Pages: 5378 1 .... 5273 5274 5275 5276 5277 .... 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.