エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
element.setAttribute - エレメントの属性を設定 - JavaScriptリファレンス
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
element.setAttribute - エレメントの属性を設定 - JavaScriptリファレンス
構文 elementNode.setAttribute(name,value) 引数: name=属性名, value=設定値 「エレメントの属性を設... 構文 elementNode.setAttribute(name,value) 引数: name=属性名, value=設定値 「エレメントの属性を設定」サンプルコード <html> <head> <title>element.setAttribute - エレメントの属性を設定</title> </head> <body> <!--エレメントの属性を設定のサンプル--> <a id="sample" rel="test">samplelink</a><br> <script type="text/javascript"> function findElement() { var element = document.getElementById("sample"); element.setAttribute("rel", "hoge"); alert("aタグのrel属性は「"+elem

