Skip to content

Commit 95a9141

Browse files
Merge pull request Nivedita-coder#16 from jishu-yadav/patch-3
Create string
2 parents c39095f + 74674e2 commit 95a9141

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)