Home > Web Front-end > JS Tutorial > javascript function

javascript function

巴扎黑
Release: 2016-12-06 09:59:23
Original
1478 people have browsed it

parseInt:
var val2 = parseInt(document.getelementbyid("val2").value);

string:
js gets the string:
1) Get the string before/after the specified character
var str_before = string.split (str)[0];
var str_after = string.split(str)[1];
2) Get the character at the specified position in the string
str1 = str.charAt(0);
3) Intercept the specified string to Specify the content between strings
var a ='I am...';
var index1=a.indexOf("中");
var index2=a.indexOf("what");
alert(a. substring(index1,index2));

Traverse objects:
for(var p in person){
alter(person[p]);
}

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Where is js written?
From 1970-01-01 08:00:00
0
0
0
js file code not found
From 1970-01-01 08:00:00
0
0
0
js addClass not working
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template