Last active
August 29, 2015 14:05
-
-
Save thesabbir/337c7d3f8d266a74bb38 to your computer and use it in GitHub Desktop.
Replacing string inside a html element
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-git1.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div class="name">anam vai</div> | |
<script id="jsbin-javascript"> | |
$('div.name').html(function (i, t) { | |
return t.replace('anam', 'The Anam'); | |
}) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks for helping :)