Rahul
Rahul

Reputation: 47126

What is Prototype's equivalent method to JavaScript's innerHTML property?

How can I retrieve HTML content using Prototype? Or how can I fetch HTML content using RJS?

Upvotes: 0

Views: 4235

Answers (3)

ptitgraig
ptitgraig

Reputation: 1

As seen on the documentation of Prototype. Use the update() method. http://prototypejs.org/doc/latest/dom/Element/update/

$('you_element').update('some fruits here');

Upvotes: 0

Arun Kumar Arjunan
Arun Kumar Arjunan

Reputation: 6857

$('fruit').innerHTML will give you the inner-html of an element with id fruit.

Access innerHTML through rjs like this: page["fruit"]["innerHTML"]

The above code will translate into: $("fruit").innerHTML;

Upvotes: 2

JJ.
JJ.

Reputation: 5475

Try something like this:

$$('div').pluck('innerHTML');

Upvotes: 0

Related Questions