Sample Output ProfileUID : 12345 First Name : John Email : John.doe@xyz.com Profile Status : Enabled Country Code : United States (+1) Phone No. : +1- 456789125 Last Generated OTP : x5xx555 Employee ID : 223344 User ID : johndoe Required Output ProfileUID : 12345 First Name : John Email : John.doe@xyz.com Profile Status : Enabled Country Code : United States (+1) Phone No. : +1- 456789125 Last Generated OTP : x5xx555 Employee ID : 223344 User ID : johndoe Have a look at the Phone No. texts in both the above outputs. index.html <pre lang="HTML"> <div style="margin-left: 2rem"> <button class="btn btn-primary" type="button" style="background-color: #001872; display: none" onclick="copyTable(document.getElementById('table'))" id="copy"> class="fa-regular fa-copy" id="table" align="center" name=""> </button> <button type="submit" id="save" style="display:none; border-style: none; background-color:transparent; color:#17d647e8; padding: 2px;" onclick="saved()">^__i class="fa-solid fa-square-check fa-2x"></button> <button type="button" id="cancel" style="display:none; border-style: none; background-color:transparent; color:#c42c2c;">^__i class="fa-solid fa-square-xmark fa-2x" onclick="canceled()"></button> </div> </td> </form> </tr> <tr align="center"> <th style="width: 20%" class="col-sm-4 text-center" scope="row"> Last Generated OTP : </th> <td style="width: 50%"></td> </tr> <tr align="center"> <th style="width: 20%" class="col-sm-4 text-center" scope="row">Employee ID :</th> <td style="width: 50%"></td> </tr> <tr align="center"> <th style="width: 20%" class="col-sm-4 text-center" scope="row">User ID :</th> <td style="width: 50%"></td> </tr> </tbody> </table>
function copyTable(el) { var body = document.body, range, sel; if (document.createRange && window.getSelection) { range = document.createRange(); sel = window.getSelection(); sel.removeAllRanges(); try { range.selectNodeContents(el); sel.addRange(range); } catch (e) { range.selectNode(el); sel.addRange(range); } } else if (body.createTextRange) { range = body.createTextRange(); range.moveToElementText(el); range.select(); } document.execCommand("Copy"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)