I have following code in HTML:
http://pastebin.com/GfrE1Pkh
I want to add text to banner_button_1 and banner_butt开发者_如何学编程on_2. How can I do that?
Thanks!
This code is horrible, but I'll assume that you can not edit the HTML and just want to change it via JS.
var bannerButton = document.getElementsByClassName('banner-button')[0];
var bannerButtonLinks = bannerButton.getElementsByTagName('a');
bannerButtonLinks [0].innerHTML += "text for banner_button_1";
bannerButtonLinks [1].innerHTML += "text for banner_button_2";
精彩评论