Stupid question I know but can’t seem to get this working. Using Chrome console, I need to get the height of some elements (can do with inspector, but this has become personal)
console.log$('#myDiv').height();
returns TypeError: Object # has no method ‘log$’
console.log $('#myDiv').height();
returns SyntaxError: Unexpected identifier
I know this is simple, and Ive looked around but cant see the forrest for the trees at this point.
console.logis a function so you need parentheses to call it, passing as argument(s) what you want to output in the console.If typing directly into the console directly, you can omit
console.log:The console automatically returns the last return value to your screen so you don’t have to
console.logwhen using the console.