メインコンテンツまでスキップ

フィールドのラベル表示要素を取得

概要

getFieldLabelElement 関数は、指定したフィールドIDに対応するラベル要素を取得します。
これにより、ラベルのカスタマイズやスタイルの変更が可能になります。

構文

atPocket.app.record.getFieldLabelElement(fieldId);

引数

引数名説明
fieldIdstring取得したいフィールドのID

戻り値

説明
HTMLElement指定したフィールドのラベル要素(存在しない場合は null)

使用可能画面

  • レコード詳細画面
  • レコード作成画面
  • レコード編集画面

使用例

const labelElement = atPocket.app.record.getFieldLabelElement('field-1');
if (labelElement) {
labelElement.style.fontWeight = 'bold';
}