Skip to content

Instantly share code, notes, and snippets.

@thesabbir
Last active August 29, 2015 14:05
Show Gist options
  • Save thesabbir/337c7d3f8d266a74bb38 to your computer and use it in GitHub Desktop.
Save thesabbir/337c7d3f8d266a74bb38 to your computer and use it in GitHub Desktop.
Replacing string inside a html element
<!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>
@thesabbir
Copy link
Author

You are welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment