Recommand · January 13, 2022 0

Getting data attributes from script code using Javascript

How can I console.log the data-text value in that javascript file? Noob here still learning. Thanks for the help or information..

Sample:
<script type="text/javascript" src="./test.js" data-text="Hello World"></script>