-
-
Save wmh/62abc0abe89ee2650c16 to your computer and use it in GitHub Desktop.
Select My Country
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
// https://kktix.com/users/edit | |
$('#user_place_id').val($('#user_place_id option:contains(臺灣)').attr('value')); |
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
// https://www.paypal.com/signup/account | |
['Taiwan','台灣','臺灣','台湾','Taïwan'].forEach(function (cn) { | |
$('select option:contains('+ cn +')').each(function () { | |
var $this = $(this); | |
$this.click(); | |
$this.closest('select').val($this.val()); | |
}); | |
}); |
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
// https://www.paypal.com/signup/account | |
document.querySelectorAll('select option').forEach(function (ele) { | |
if (ele.innerText.indexOf('台湾') != -1) { | |
var val = ele.value; | |
while (true) { | |
ele = ele.parentNode; | |
if (ele == null || ele.tagName.toLowerCase() == 'body') { | |
break; | |
} | |
if (ele.tagName.toLowerCase() == 'select') { | |
ele.value = val; | |
} | |
} | |
} | |
}); |
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
// jQuery | |
$('#country_id').val($('#country_id option:contains(Taiwan)').attr('value')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment