Hello,
can someone advice if I handle onClick with vanilla js is working but if I use the onclick with Solidjs is not working.
I do not get any errors:
import { JSX, createSignal } from 'solid-js';
import { render } from 'solid-js/web';
const App = (): JSX.Element => {
document.addEventListener('DOMContentLoaded', function () {
const button = document.getElementById('myButton') as HTMLButtonElement;
button.addEventListener('click', function () {
console.log('Experiment C - vanilla js');
});
});
return (
<>
<button
id="myButton"
style={{ 'z-index': 3000, background: 'red' }}
>
click -JS
</button>
<button
class="bttn-solid"
style={{ 'z-index': 3000, background: 'red' }}
onClick={() => console.log('Experiment C ')}
>
click me-Solid
</button>
</>
);
};
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Where is it that you're trying to use that code?
All good now
The issue was in the bundler
Hello,
Hope this message finds you well
I just want to know how we connect AEM with soldJs.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Like
Replies