Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

How do we write an HTML search function?

I need to write a search function using HTML. It has to use my special link that will pull data from one website, into mine.

1 Answer

You cannot provide a search function with just HTML. You need to learn PHP to do that.

Agreed, the HTML you will need will be a form element, a search input, and a button if you want (otherwise enter key) to do the search, and any extra inputs like drop downs, radio buttons, etc. The actual search has to happen with a server side language. Ruby, PHP, etc.

By special link, I assume you're talking about a JSON response?

Not really a JSON response, I think. Basically, it's just some HTML code that will display the search functions from another site. I think it's created using the Object element.

Do you have a link or some example? I'm not really sure how to answer your question right now.