petcity

var name_sp = document.getElementsByClassName('p-name'); var money = document.getElementsByClassName('p-price'); var image = document.querySelectorAll('.p-img img'); var win = window.open(); for (var i = 0; i < name_sp.length; i++) { win.document.write('<img src="http://www.petcity.vn'+image[i].getAttribute('src')+'">'); win.document.write("</br>"); win.document.write("Tên sp : "+name_sp[i].innerHTML+"</br>"); win.document.write("Giá tiền : "+money[i].innerHTML+"</br>"); win.document.write("Tên của hình ảnh : "+image[i].getAttribute('src').split('/')[3]+"</br>"); win.document.write("</br>"); }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.