-6

How to use prototype instead of innerHTML while assigning the values to the elements of the html page??

Esailija
  • 138,174
  • 23
  • 272
  • 326
Pooja
  • 53
  • 6
  • 1
    `prototype` and `innerHTML` server completely different purposes in JavaScript. Read some tutorials on those topics. – Sirko Jun 26 '12 at 10:25
  • This is not an answerable question right now. Please provide more information and perhaps some source code of what you have tried. – Michael Jun 26 '12 at 10:25
  • people suggest to use prototype instead of innerHTML... I'm very new to html, so please suggest.. Can we replace prototype with innerHTML – Pooja Jun 26 '12 at 10:26
  • `$('fruits').update('

    Kiwi, banana and apple.

    ');` from http://www.prototypejs.org/api/element/update
    – Esailija Jun 26 '12 at 10:30
  • possible duplicate of [Replace text inside a DIV element](http://stackoverflow.com/questions/121817/replace-text-inside-a-div-element) – Esailija Jun 26 '12 at 10:31
  • I think ".update" method is the in-built method for jQuery.. but I'm using javascript. Is there any in-built method in js? – Pooja Jun 26 '12 at 10:35
  • You need to clarify `people suggest to use prototype instead of innerHTML`. Where did you read this? Show the link. As it is, I can only guess the "people" mean using prototype.js library.. – Esailija Jun 26 '12 at 10:36
  • Is there any method in prototype.js library to update the text of an element? – Pooja Jun 26 '12 at 10:39
  • @Pooja yes, I just linked a duplicate question of that – Esailija Jun 26 '12 at 10:44
  • @ Esailija: "http://stackoverflow.com/questions/121817/replace-text-inside-a-div-element"... this is the link where they say its not a good style to use innerHTML... – Pooja Jun 26 '12 at 10:49
  • You didn't know that link before you made your question and comment about "people suggesting prototype" so I think you're trolling – Esailija Jun 26 '12 at 11:32
  • @ Esailija: whoever has posted it in that link come under "people" category.. u asked me for the link and I posted it.. – Pooja Jun 26 '12 at 12:52

1 Answers1

0

innerHTML and prototype are used for two completely different purposes in JavaScript. there is no comparison.

see the following links

InnerHTML

Prototype

Raab
  • 34,778
  • 4
  • 50
  • 65