Change Google Translator Text

时间:2015-12-04 21:21:32

标签: jquery css google-translator-toolkit

Can you change the text on the Google Translator to display Translator instead of select language?

https://jsfiddle.net/ogp8xobz/2/

I have tried:

$('#google_translate_element').text("Translator");
$('#google_translate_element span').text("Translator");

1 个答案:

答案 0 :(得分:2)

该元素(#google_translate_element)包含许多子元素,您正在寻找的文字位于#google_translate_element内div内div内的锚点内的span内。要正确地执行此操作,您应该只处理最后一个范围:

  $($(" #google_translate_element .goog-te-menu-value span")[0]).html("this one?");

请参阅小提琴:https://jsfiddle.net/svArtist/tgokbf5j/