-1

I'm wondering if someone could show me how to grab the value of an input form and run it through J-query feed to finally dump it in a div.

https://jsfiddle.net/e82fes66/3/

HTML

<div><input value="Search Here"></input></div>
<div id="feed" class="feed"></div>

CSS

div {margin:25px;}
.feed {width:300px; height:200px; border:1px solid #000; overflow-x:hidden;}

On the fiddle you'll see an input box and a div with the id 'feed'.. Ideally a user would type in something like cnn.com into the input field & in the #feed div would appear a feed (could add a submit).

2
  • 1
    #feed div would appear a feed but from where? Welcome to SO, Please formulate your question with clear problem statement.
    – Satpal
    Nov 2, 2015 at 12:59
  • Hi Satpal - thanks for the tips. Lets say I type in the search bar www.cnn.com & click submit - what I'm trying to achieve is a JQuery script that puts all the html from www.cnn.com into a div on the same page? is this possible.. cheers, Ryan. :) Nov 3, 2015 at 8:57

1 Answer 1

0

You mean something like this?

<div>
    <input placeholder="Search Here" id="search"/>
</div>
<div id="feed"></div>

$('#search').on('keyup', function(){
   $('#feed').html('<p>' + $(this).val() + '</p>');
});
2
  • Thats pretty cool Krenor - on the right lines. When I type CNN.com in the search bar it appears below - what We're looking for is the rss/html feed from cnn.com in the #feed div? Any thoughts.. cheers! Nov 3, 2015 at 8:54
  • You could probably try an AJAX GET request. Maybe there's already an existing plugin for this, as I don't know since I've not worked with RSS feeds yet.
    – Krenor
    Nov 3, 2015 at 9:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.