0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

.aspx.csファイルでgetElementById()を使って.aspxファイルのラベル値を取得する

Posted at

はじめに

前任の担当者からの引き継ぎが受けられず3Dセキュア2.0への対応でつまづいてしまった点がありました。
その中で特に困った点
「.aspxファイルのラベル値を.aspx.csファイルで取得する方法」を記載します。

結論

letdocument.getElementById()を使ってラベル値を取得できました。

説明

最初にletで取得したいラベル値を宣言します。

let dummylbl

次にdocument.getElementById()でラベル値を取得しました。

dummylbl = document.getElementById('lblxxx').innerText

今回は記述する場所にも意味がありましたので、このように分けて記述する必要がありました。
※宣言はfunctionの外。ラベル値の取得はfunctionの中といった形です。

他にも値が取得できているか確認する際はalertを使いポップアップ表示で確認します。

alert(dummylbl)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?