Last active
December 19, 2015 11:29
-
-
Save kikegarcia/5947878 to your computer and use it in GitHub Desktop.
Select and change A href (adds target blank too), Select Option & Img Src
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// a href Selector and new attr | |
var linksToMondosonoro = $('a[href="/video/urltocatch"]'); | |
$(linksToMondosonoro).attr("href", "http://www.newurl.com") | |
$(linksToMondosonoro).attr("target","_blank"); // añade un target blank | |
// Select Selector and new attr | |
var selectToMondosonoro = $('#selectmodifier option[value="/video/selecttocatch"]'); | |
$(selectToMondosonoro).val('http://www.newurl.com'); | |
// Img variable and the new property | |
var new_src = "/nueva/imagen.jpg"; | |
$('img[src="/img/large/1.jpg"]').attr('src',new_src); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment