linking an element by id URL

Not open for further replies.


New Member

I recently got into learning about coding and I'm trying to develop a widget for a WordPress site.
I'm so close it's ridiculous but can't seem to get the last bit right. If you look at the code below
you will see it asks for your

  1. phone number
  2. user name
  3. password

This generates a completed URL which sends a text message however getting the element-by-id to
return as a link is proving difficult. I have gotten as far as getting the Id to show as "Send Text" but
it doesn't link to anything. I would be delighted if somebody could help me with this

Thank You

<!DOCTYPE html>

<p>Click the button to demonstrate the prompt box.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo" ></p>

function myFunction()
var x;

var number=prompt("Please enter your number (e.g. for IRE - 35387***) (for multiple numbers use a comma to seperate them","");
var user=prompt("Please enter your user name","");
var password=prompt("Please enter your password","");

if (name!=null)
x="<a herf=""+user+"&api_pwd="+password+"&txt=%2301%23&dest="+number+"&tag=Text%20On">Send Text</a>";

Not open for further replies.
Award-winning Mac antivirus and Internet security software