Nisha Patel
Problem:
I have two PHP files and a JS file. When the div is clicked, it goes to the new page with the # appended to the URL, so it scrolls to that comment ID. It is working where it goes to the page and scrolls to the bottom of the page every time, even if the comment is not on the bottom of the page. But the correct comment div has the cursor blinking next to it. CSS : the focus is not doing anything, I think maybe because the js reloads the window first, then sets it.
How can I use that blinking cursor to change the CSS of the element that has the cursor on it (hover does not work because the mouse is not hovering; the cursor just has that element selected.)
How can I make it scroll to the correct element and not always the bottom?
main page
new page with comments
Js
Solution:
If the cursor is blinking next to it, you may be able to use the :focus or :active pseudo-classes in your CSS.
Example:
In the event, that does not work. Try using JavaScript's document.activeElement to either add a class for the styling, or do it directly in the JavaScript.
Suggested blogs:
>How to access the state using Redux RTK in the React Native app?
>Building Web API using ASP.NET (C#)
>How React hooks Completely replace redux?
>How to Build a RESTful API Using Node Express and MongoDB- Part 1
>5 easy ways to Repair the .NET Framework on Windows
>Integrate SASS into the build and consume a UI toolkit
>How to build an Electron application from scratch?
>How to delete duplicate names from Array in Typescript?