javascript - Change a value with a drop down list -


i have iframe need change 1 parts of elements value

iframe src="http://www.twitch.tv/username"/ 

so idea user select name dropdown list , change iframe username correct user name:

so:

  • steve selected in drop down list.

  • page reloads iframe having src="http://www.twitch.tv/stevesusername/"

what cool if page did not have reload , iframe had reload.

thank

are trying change source of "casterchat" iframe only? can use this:

$(document).ready(function(){     $('#caster').on('change', function(){         $('#casterchat').attr('src', 'http://www.twitch.tv/' + $('#caster').val() + '/chat?popout=');     }); }); 

don't forget load jquery make work.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -