Replies: 1 comment
-
Have you tried asking CoPilot? Copy/paste of your questions results in: Define a JavaScript function to select elements: function selectElement(selector) {
return document.querySelector(selector);
} //Call this function from Blazor using JSInterop:
Handling JavaScript Files on Page Change Ensure JavaScript files are loaded correctly:
Avoid modifying the DOM directly: @guardrex will tell me if this is incorrecto |
Beta Was this translation helpful? Give feedback.
-
Hello!
How can I select an HTML element/tag with Blazor attributes (without using @ref)? I didn't find any feature in it, which could help me.
I want something like javascript selector methods or jquery selector.
But still, for now, I'm using JQuery by JSInterop. However, I still have a lot of problems!
After running my Blazor app for the first time, the jQuery methods and JavaScript code are working. But after changing the page, the old javascript files remain on my web page and break my app!
To make matters worse, new JavaScript files not working means that the new JavaScript files are loaded and available, but not executed.
can you help me?
Beta Was this translation helpful? Give feedback.
All reactions