Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-2.1.1.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
<button id="click">Run</button>
<div id="data">This test is <b> Attempt {count}</b> and {count} something blah</div>
</body>
</html>
 
div#data {
  margin-top:10px;
  padding:10px;
  border: 1px solid red;
}
 
$('button#click').click(
function() {
// FUNCTION START
  $('#data').html( function(index,oldHtml) {
    return oldHtml.replace(/\{count\}/gi, '1');
  });
// FUNCTION END
});
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
redfox05pro
0viewers