4

I think theres one https://developer.mozilla.org/en/JavaScript/Reference but for for things like what properties/functions a Textarea object will have, where can I get it?

I know textarea have properties like selectionStart, selectionEnd but what others? where can I find that info?

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
  • Actually in IE up to and including version 8, textareas do not have `selectionStart` and `selectionEnd` properties and you need a fairly complicated workaround to get the equivalent functionality. – Tim Down Nov 30 '10 at 11:24
  • @Tim Down, ... IE again ... I don't like hacks, it just makes code crappy ... but a look at [MSDN](http://msdn.microsoft.com/en-us/library/ff974768%28v=VS.85%29.aspx), there is `selectionStart` except that it have a big logo IE9. How can I see what is the alternative for <=IE8? – Jiew Meng Nov 30 '10 at 12:04
  • 1
    I'm afraid that's just how web development is. If you need the IE <= 8 selectionStart/End code, here it is: http://stackoverflow.com/questions/235411/is-there-an-internet-explorer-approved-substitute-for-selectionstart-and-selectio/4207763#4207763 – Tim Down Nov 30 '10 at 12:12

2 Answers2

7

The Gecko DOM Reference is pretty complete.

For the dark side (IE-specific stuff), there's also Microsoft's HTML and DHTML Reference

And for cross-browser advice, consult QuirksMode (thanks Raynos)

Sean Patrick Floyd
  • 292,901
  • 67
  • 465
  • 588
  • 2
    Please dont recomend microsoft's website. People might start using .htc files to do black magic again. – Raynos Nov 30 '10 at 11:09
  • 1
    Of course I don't recommend it, I thought *And for the Dark Side* was pretty obvious. But AFAIK the DOM implementations in IE are somewhat different, so I guess if you are serious about cross browser support, you will have to go there to. It's a necessity, not a recommendation. – Sean Patrick Floyd Nov 30 '10 at 11:13
  • 1
    Good point. On that note I would mention http://www.quirksmode.org/ for aiding with serious cross browser support. – Raynos Nov 30 '10 at 11:19
3

If you need to know anything about javascript

Search for it in google and add the word "mdc" on the end. I personally find the internal MDC search bar annoying and unhelpful.

in your case :

https://developer.mozilla.org/en/DOM/HTMLTextAreaElement

[Edit]

I actaully do this for everything. For example rather then wading through the MSDN website if I need to know anything about a transact sql command. I search for the command in google and add "t sql msdn". If only people used the google search engine internally on their websites rather then their own half baked search engine.

Raynos
  • 166,823
  • 56
  • 351
  • 396
  • 1
    +1 - I do this all the time when I want to double-check something. For IE specific methods, I add "dhtml msdn" on the end instead. – Andy E Nov 30 '10 at 11:10
  • 1
    @AndyE For IE specific methods I throw the code away and do it properly. – Raynos Nov 30 '10 at 11:12
  • good luck with that :-p there is no "[doing] it properly" in IE. – Andy E Nov 30 '10 at 11:14
  • I can top that: for IE specific methods I track down the user's home address and have a special squad break into his house and install a proper browser – Sean Patrick Floyd Nov 30 '10 at 11:15
  • 2
    @S.P.Floyd psh! I use IE's ActiveX controls to install ubuntu and reboot their computers. far less hassle and they get a proper OS aswell. – Raynos Nov 30 '10 at 11:18