1

I need to change a property, which starts with -webkit-(and the other browser-specific statements), in Javascript. All of them start with dash. How am i supposed to write this?

In particular, the thing i need is -webkit-user-select. I know it should be something like webkitUserSelect, but no idea of what exactly.

Thanks

Toffer
  • 75
  • 9
  • (The name of the real post, of which this one is duplicate, is not ment to be searched for) – Toffer Oct 09 '15 at 12:08

1 Answers1

2

Just like you write any property that can't be used with dot notation:

element.style['-webkit-user-select'] = 'none';
Schlaus
  • 18,144
  • 10
  • 36
  • 64