html - Is it possible to use JQuery to load a url into an iframe when a link is clicked on the same page? -


is possible using jquery load src of <a> tag iframe on same page linked clicked if can not edit html?

something similar instead of getting value input src value src of link person clicks on?

http://jsfiddle.net/kbwood/dlprk/

is want?

$('#url').click(function(e) {      e.preventdefault();      $('#display').attr('src', $('#url').attr('href'));  });
iframe { width: 100%; height: 50%; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>  <iframe id="display"></iframe>  <br>      <a type="text" id="url" href="http://jquery.com">test</a>


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -