+ 1
How to Make this is?
Ilustration : [inputtext] [button] i fill in inputtext be (test.html) [test.html] [button] then i click the button to open the link/new tab result : www.testing/tester/test.html
10 Answers
+ 1
Do you want the link to open in new tab? In that case, add target="_blank" to your a tag.
+ 1
Mr ASR what do you want then? Be a bit more clear.
0
no
0
if i fill in inputtext "test.html" then i click the button result in new tab :
www.testung/tester/test.html how?
0
Mr ASR hi,
It depends on how you set your button.
If you just have that element , then you can add an EventListener in js or a onclick attribute in the tag with a function set in js.
You can also nest a a tag inside your button and use target attribute as said by Sajid before.
Or use input of type submit instead of button and nest your inputs inside a form .
* <button onclick="myTest()">Test</button>
// Set a myTest() function in js to handle the button pressed.
* <button><a href="your link here" target="_blank">Test</a></button>
*<form action="your link" method="post">
<input type="text" name="test" >
<input type="submit" value="test button"">
</form>
//The submit will be handled on the serverside.
If you program on sololearn, the simplest would be the nested a tag.
Your test.html would be another bite of code.
You copy paste the link to it as your href in the a tag.
0
what i must add in the javascript? EmmanueLZ.
0
You'll find some ways to achieve what you want in this link.
https://www.developintelligence.com/blog/2016/04/javascript-redirect-how-to-redirect-a-web-page-with-javascript/#:~:text=window.,to%20in%20the%20above%20code.
Try by yourself, and if you're still stuck, post your try, so we check how to resolve it.
Don't forget, if your input contain part of the link , you'll have to get that value first, than treat in in a way it will be included in the full path of the URL, and then do the stuff to redirect.
Hope it will help, good luck.
0
And this link gives a more precise exemple for your case :
https://www.geeksforgeeks.org/javascript-redirect-a-url/amp/
0
thanks bro for help
0
Is target=_blank only avaliable for computer?