Message from JavaScript discussions

June 2019

— Alright cool


I haven't much experience, but you can't have the console in your page - unless you want to create/design your own console.
Apart from that I think you could do something like that..
Have a span or p tag.. Make it top=0, right=0 to put the display area at the top right of your page
Get the tag by id, and set the text to the computation, the addition of two numbers..

— Hi , I made one anchor tag as a sticky that scroll to the bottom of the page on click By calculating the height of that bottom element class and put that height into window.scroll this works in all browsers except internet explorer any solution

Message permanent page

— What is "height of element class"? element has height, class has attributes

— You want to write the code on the console?

— Is this supposed to be a file??

— Learn

— Hello

— Hi

— Did you get the desired output? If you didn't get it than I will suggest you rather save it as a file with ".html" extension.. Put the code between script tag.. And open the file on the browser..
Also.. IMO, using JavaScript this isn't a good practice..

Message permanent page

— Do anybody else what coding train YT ?

— 4000 and it's being calculated using this method

var getOffsetTop = function (elem) { // Set our distance placeholder var distance = 0; // Loop up the DOM if (elem.offsetParent) { do { distance += elem.offsetTop; elem = elem.offsetParent; } while (elem); } // Return our distance return distance < 0 ? 0 : distance; }; // Example var elem = document.querySelector('#some-element'); var offset = getOffsetTop(elem);

Message permanent page