javascript - How to get the text of a textarea with a prototype click event? -


There are several textures on my page and I need some text to click on it. I would like to know how to do this in jQuery but I need a prototype / javascript solution. At the moment, which I have tried so far:

  $$ ("textarea"). Respond to each (function (L) {el.observe ('click', responseToClick); function (event) {var element = Event.element (event); var text = element.innerHTML (); console.log (Text);}});   

There is no error in the console, but if I want the text, how can I get it?

Edit: This is the solution I forgot the document. Already equal in prototype and thanks to Brusqui I can edit the correct prototype method to get the text:

  document.observe ("dom: loaded", function () {$$ ("textarea") Each (function (L) {el.observe (click 'Click', Click Replay); Reactions on the function Click (Event) {var element = Event.element (event); var text = element.value ; console; log (text);}}};});   

PS: prototype Vesion is 1.7.0

You can use, or Its nickname:

  var element = Event.element; var text = $ F (element); console.log (text);    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -