Skip to content

Commit 74674e2

Browse files
authored
Create string
1 parent c39095f commit 74674e2

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎string‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<body>
4+
5+
<h2>JavaScript String Methods</h2>
6+
7+
<p>The search() method returns the position of the first occurrence of a specified text in a string:</p>
8+
9+
<p id="demo"></p>
10+
11+
<script>
12+
var str = "Please locate where 'locate' occurs!";
13+
var pos = str.search("locate");
14+
document.getElementById("demo").innerHTML = pos;
15+
</script>
16+
17+
</body>
18+
</html>
19+

0 commit comments

Comments
 (0)