I want to make this script realtime by jQuery, How do I do that?

ساخت وبلاگ

Vote count: 0

I am currently leaing Javascript and I am at the most basic level someone could be.

I wrote a simple script for generating a referral link for envato market.

Its a very simple function which gets the profile url and useame and a onclick is used to combine these variables and put the ?ref= in there.

<!DOCTYPE HTML>
<html> <head> <title>JS</title> </head> <body> <script> function refferalGen() { var userName = document.getElementById("useame").value; var profUrl = document.getElementById("profurl").value; var result = (profUrl) + "?ref=" + (userName); document.getElementById("resulttxt").value = result; } </script> <input style="width:250px" type="text" id="useame" placeholder="Useame" /><br> <input style="width:250px" type="text" id="profurl" placeholder="Profile Url" /><br> <input style="width:250px" type="text" id="resulttxt" placeholder="Result Will be printed here" /><br> <input style="width:250px" type="button" name="clickbait" onclick="refferalGen()" value="Clickbait !" /> </body>
</html>

I want it to be so that I dont have to use the button to get the result Instead it is real-time.

When i type in the useame textfield it automatically updates the result field instantly and same goes for the profile url field.

Thanks to anyone who replies.

asked 30 secs ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 307 تاريخ : دوشنبه 31 خرداد 1395 ساعت: 16:44