Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

jQuery - replaceWith() method

0 votes
12 views
added Aug 21 in jQuery by LC Marshal Lieutenant (14,570 points)

To replace the element with jquery

elem = $('#edit-profile-basic-field-ic-und-0-value');
elem.replaceWith(`
<div class="verified-input-wrapper <?php print $identity_verified ? 'v-true':'v-false'?>">
  ${elem[0].outerHTML}
  <button class="btn btn-danger btn-verified v-false" data-toggle="modal" data-target="#edit-profile-basic-field-identity-documents-modal" onclick="event.preventDefault();">GET VERIFIED</button>
  <button class="btn btn-success btn-verified v-true" data-toggle="modal" onclick="event.preventDefault();">VERIFIED</button>
</div>
`);

 

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...