Search result open in new tab

Asked

Viewed 408 times

1

I have a simple search engine that does the search in html itself, how can I make the search results be shown in a new tab?

<input type="text" placeholder="Digite sua pergunta"  autofocus name="query" size="16" style="font-size: 11 pt; color: #000000; font-family: Verdana; font-variant: small-; border: 1 solid #000000">
</font></font> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> 
<input  type="submit" value="Buscar" style="font-size: 8 pt; color: #000000; font-family: Verdana; font-variant: small-caps; border: 1 solid #000000">

Search site http://leituracrista.com/indice/

  • Miguel just a detail, the tag <font> was neglected, you should now do the styles directly by CSS, https://www.w3schools.com/tags/tag_font.asp plus the closing tag </font> is in the wrong place, should come after <font>

  • Thank you! @hugocsl

2 answers

1


1

I don’t know if it helps you but you can do it like this:

You have to figure out a way to get what’s typed inside the input name="query" and place at the end of the link query=

<input onclick="myFunction()" type="submit" value="Buscar" style="">

<script>
function myFunction() {
    window.open("http://leituracrista.com/indice/?query=.....");
}
</script>

I know it’s not the "complete" answer but sometimes it helps you. With jQuery I believe you easily capture the value of input search and place where you want. But it is not very my area so I will not extend.

  • I believe that this is the way, so it is possible for example to add only the search button on any site, I await more information from others

  • Now I need to capture this query value and play at the end of the address

  • That’s right Miguel, I believe it is not something complicated for that already dominates JS, but as it is not my case only gave you a north. Other site collaborators will surely answer you even better than me.

Browser other questions tagged

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