| Page 1 of 1 | [ 2 posts ] |
|
How can I access the innerHTML of div , when the div is clicked.
I try this but it returns undefined. YUI().use('node', function(Y) { var makeChoice=function(e) { //var thisDiv=(evt)? evt.target:window.event.srcElement; var target=e.target; alert(target.innerHTML); document.getElementById("searchField").value=target.innerHTML; document.getElementById("popups").innerHTML=""; }; Y.one('.divSuggestions').on('click', makeChoice); }); |
|
Code: var makeChoice = function(e) { var target = e.target; console.log(target.get('innerHTML')); }; http://yuilibrary.com/yui/docs/node/#node-properties |
| Page 1 of 1 | [ 2 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group