Skip to content Skip to sidebar Skip to footer

Cannot Read Property 'scrollheight' Of Null

The error message I am getting is Cannot read property 'scrollHeight' of null: var b = document.getElementById('chat-messages'); b.scrollTop = b.scrollHeight; var lst = b.scro

Solution 1:

Correct ways in jQuery are -

$('#chat-messages').prop('scrollHeight') OR $('#chat-messages')[0].scrollHeight

Hope it helps.

Post a Comment for "Cannot Read Property 'scrollheight' Of Null"