value/checked properties and change/input/blur event
listenersvalue or checked props along with input, change, and blur events. This approach allows flexible
integration with any form library.<p-input-text name="myInputText" label="Some Label"></p-input-text>
<p-text>Value: ''</p-text>
<script>
const debugElement = document.querySelector('p-text');
// In order to change the input value programmatically you can change the value property of the element directly: inputText.value = 'new value';
const inputText = document.querySelector('p-input-text');
inputText.addEventListener('input', (e) => {
setDebugText(e.target.value);
});
function setDebugText(value) {
debugElement.innerText = `Value: ${value}`;
}
</script>
<form>
<p-input-text name="myInputText" label="Some Label" />
<p-button type="submit">Submit</p-button>
</form>
