How do I make a form modify words?

Asked

Viewed 52 times

-4

  • 2

    What were your attempts to solve the problem?

1 answer

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

You are not signed in. Login or sign up in order to post.