JavaScript How to get jquery to find href that is phone number? jquery find href value,jquery find href contains string,jquery

I'm trying to get all callable phone numbers out of an html-received with a get:

onload: function (data)
{
    data = $.parseHTML(data.response);
    var content = $.trim($(data).find('[href^=callto:]').text());
    console.log(content)
    //var content= $(data).find('.');
}

The data is correct, i successfully found find('.tel'), a class used in the html.

Answer:1

$('a[href^="tel:"]') will give you all anchors with a tel: scheme.

Using your sample code: data.find('a[href^="tel:"]')

Answer:2

This is how I managed to resolve this problem on my end. :)

/* All phone numbers to href */
var regex = /\(?([0-9]{3})\)?([ .-]?)([0-9]{3})\2([0-9]{4})/;
$('tr td:nth-child(3)').each(function() {
    var text = $(this).html();
    text = text.replace(regex, "<a target='_blank' href=\"tel:$&\">$&</a>");
    $(this).html(text);
});
Answer:3

I have the following code in a SharePoint aspx page ( I got an error that said I cannot use form controls... that is why the form tags are not there): <div id="formBox"> Here is a link : <a ...

I have the following code in a SharePoint aspx page ( I got an error that said I cannot use form controls... that is why the form tags are not there): <div id="formBox"> Here is a link : <a ...

  1. post without using form
  2. validation without using form
  3. jquery validation without using form tag
  4. submit form without using form tag
  5. javascript validation without using form
  6. upload-file-without-using-form-submit
  7. submit data without form using ajax
  8. php upload file without using form
  9. setting post variable without using form

I'm trying to find the most graceful way to distinguish between single and double clicks in Bacon.js, but I feel like I'm not completely grasping how this works. The following works for detecting a ...

I'm trying to find the most graceful way to distinguish between single and double clicks in Bacon.js, but I feel like I'm not completely grasping how this works. The following works for detecting a ...

I have a input that have type like this: <input class="emailSend" name="emailSend" type="hidden"> Then I have a multiple select option like this <div class="controls"> <select ...

I have a input that have type like this: <input class="emailSend" name="emailSend" type="hidden"> Then I have a multiple select option like this <div class="controls"> <select ...

  1. fill input type file javascript
  2. fill input type date
  3. fill input type file
  4. auto fill input type file
  5. pre fill input type date
  6. jquery fill input type file
  7. jquery fill input type text
  8. jquery fill input type date
  9. js fill input type file

The cell content selection works successfully for a numeric text box (internally handled as a Kendo NumericTextBox control) but for some reason, it doesn't work with a plain textbox column. Attached ...

The cell content selection works successfully for a numeric text box (internally handled as a Kendo NumericTextBox control) but for some reason, it doesn't work with a plain textbox column. Attached ...

  1. kendo ui grid select row
  2. kendo ui grid select all rows
  3. kendo ui grid select row programmatically
  4. kendo ui grid select row event
  5. kendo ui grid select column
  6. kendo ui grid select all checkbox
  7. kendo ui grid select single row
  8. kendo ui grid select cell programmatically
  9. kendo ui grid select row by index
  10. kendo ui grid select first row by default
  11. kendo ui grid select row on button click
  12. kendo ui grid select row after refresh
  13. kendo ui grid select row angular
  14. kendo ui grid select
  15. kendo ui grid select all
  16. kendo ui grid select event
  17. kendo ui grid select multiple rows
  18. kendo ui grid select row by id
  19. kendo ui grid select first row
  20. kendo ui grid select row checkbox