Jump to content

On iframe src change


retro-starr

Recommended Posts

Below I made a function that I feel should've updated the input field "url_input" with the value of the new src. This does not work though, so my question is what am I doing wrong?

 function iframe_address() {  $('#content["src"]').change(function() {    $('#url_input').attr('value', change());  }); };

#content being the iframesrc is the attribute I want to watch#input_input being the input fieldvalue being the attribute I want to update

Link to comment
Share on other sites

Just found out that JS/JQuery change() only works for input, select, and text areas not iframe; so I figure I'd have to do load() instead.This seems like it'd work, but I need someone more versed in JQuery to aid me on this.

 $('#content').load(function() {  var x = $('#content[src]');  $('#url_input').attr('value', x); });

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...