-4
I’d like to put a text in a form
and it turns into a "link", for example:
login id 76561198281829407
Modify to: https://steamcommunity.com/id/76561198281829407
I need an example of HTML and JS or jQuery for this.
-4
I’d like to put a text in a form
and it turns into a "link", for example:
login id 76561198281829407
Modify to: https://steamcommunity.com/id/76561198281829407
I need an example of HTML and JS or jQuery for this.
1
You can use Jquery to your advantage. Try the following and see if this is what you are looking for.
$(function() {
$("#inserir").click( () => {
var link = $("#link").val();
console.log(link)
$("#linkuser").html("<a href='https://steamcommunity.com/id/"+link+"' target='_blank'>Link Steam</a>");
});
});
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title> ... </title>
</head>
<body style="background-color:powderblue;">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<h2> Digite seu ID:</h2>
<input id="link" type="text" name="link" /> <br/>
<input id="inserir" type="button" value="Enviar" />
<div id="linkuser">
</div>
</body>
</html>
This will solve your problem, just fit your code.
Browser other questions tagged javascript html jquery
You are not signed in. Login or sign up in order to post.
What were your attempts to solve the problem?
– Augusto Vasques