HTML5から導入された data-* 属性は、JavaScriptに渡したいデータをHTML側に埋め込んでおくための標準的な方法です。 getAttribute ('data-userid') のようにして値を取得することで、HTMLとJavaScriptの間でスムーズにデータの受け渡しを行うことができます。
The HTML code is in the index.html file. The JavaScript code is in the index.js file.
The HTML code is in the index.html file. The JavaScript code is in the index.js file.