Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app='app'>
<head>
<script src="https://code.jquery.com/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body  ng-controller="MyCtrl">
      <button onclick="removePs('target')">Remove Multiple Ps</button>
    <div id="target">
        <p>1111</p>
        <p>2222</p>
        <p>3333</p>
    </div>
  
  <div>
    <p>1111</p>
    <p>2222</p>
    <p>3333</p>
</div>
</body>
</html>
 
    function removePs(div_id) {
      var html = '<p>';
      $('#' + div_id + ' p').each(function(i, p) {
        html += $(p).html() + '</br>';
      });
      html += '</p>';
      $('#' + div_id).html(html);
    }
//removePs('target');
Output

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

Dismiss x
public
Bin info
mzohaibqcpro
0viewers