I'm working with 123FormBuilder, which adds an iFrame to your website. I need to access a data attribute within one of the input fields.
How would I access this within the iFrame? I have the below code, but I'm not sure it'll work as the HTML is in an iFrame.
document.querySelector([data-id=1203246]).value = clientId;
This is the code for the input field of 123FormBuilder, within an iFrame:
<div data-role="container" data-type="virtual-form-table-row" data-hash="00000019" data-type-id="0" data-colspan="20" data-num-children="1">
<div data-role="control" data-type="text" data-hash="0000001a" data-type-id="23" data-colspan="20" data-renderer-type="tln" data-id="1203246" data-is-active="1">
<label data-role="label" id="text-0000001a-acc" data-i18n-text="control_label_1203246">GA Hidden Field</label>
<dt data-role="instructions" id="text-0000001a-instr-acc" data-is-empty="1" data-i18n-text="control_instructions_1203246"></dt>
<div data-role="input-row" data-is-first-row="1" data-is-last-row="1" data-fill-colspan="0">
<div data-role="input-container" data-ui-role="ui-element" data-size="full">
<span data-role="prefix-label" id="price-0000001a-prefix-acc" style="opacity: 0.5;"></span>
<input type="text" data-role="i123-input" data-no-theme="" aria-labelledby="text-0000001a-acc text-0000001a-error-acc text-0000001a-instr-acc" placeholder="" style="padding-left: 8px;">
</div>
</div>
<label data-role="error" id="text-0000001a-error-acc" data-is-empty="1"></label>
</div>