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

javascript function

巴扎黑
Release: 2016-12-10 09:17:27
Original
1106 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:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template