JAVASCRIPT check if string contains javascript - Net-Raft.com

Welcome aboard! We are happy you are here and wish you good net-raft!




Together We Can Simplify The World
Just a Web Code Solution

check if string contains javascript


 112

 JAVASCRIPT


1

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<body >

<script>

var str = "I am years old!";
if (str.match(/^(?=.*[a-zA-Z])(?=.*[0-9])/)) {
$("body").text("it is ok");
}
else
{
$("body").text("Please type numeric and alphabetic characters");
}

</script>
</body>
</html>


  
The power of the user (%)
32%

 JAVASCRIPT


3

<!DOCTYPE html>
<html>
<body>

<div id="div1">This is javascript !</div>

<button onclick="myfunction()">click</button>

<div id="test"></div>

<script>
function myfunction() {
var str = document.getElementById("div1").innerHTML;
var post = str.search("javascript");
document.getElementById("test").innerHTML = post;
}
</script>

</body>
</html>


  
The power of the user (%)
53%



The most helpful JAVASCRIPT solutions

How to get client machine name or computer name with javascript ?How to get client machine name or computer name with javascript ?JAVASCRIPT

Click to see more ...

  2.2K     357

get client hostname javascriptget client hostname javascriptJAVASCRIPT

Click to see more ...

  1.3K     237

detect ie javascriptdetect ie javascriptJAVASCRIPT

Click to see more ...

  672     147

get ip address javascriptget ip address javascriptJAVASCRIPT

Click to see more ...

  407     72

how to create foreach class using javascript ?how to create foreach class using javascript ?JAVASCRIPT

Click to see more ...

  306     65

create qr code javascriptcreate qr code javascriptJAVASCRIPT

Click to see more ...

  275     64

get current url using javascriptget current url using javascriptJAVASCRIPT

Click to see more ...

  232     53

How replace reverse solidus using javascript ?How replace reverse solidus using javascript ?JAVASCRIPT

Click to see more ...

  154     41

get filename using javascript get filename using javascript JAVASCRIPT

Click to see more ...

  151     39

how to create the connect to a database with ADODB using javascript ?how to create the connect to a database with ADODB using javascript ?JAVASCRIPT

Click to see more ...

  119     36