Oracle APEX Javascript API

How to Set and Get Item Value Using Javascript In Oracle APEX?

1. Get Item Value In Oracle APEX Using Javascript API.

apex.item( "P6_NAME" ).getValue();
$( "#P6_NAME" ).val();
$v( "P6_NAME" );
$x("P6_NAME").value;

2. Set Item Value In Oracle APEX Using Javascript API.

apex.item( "P6_NAME" ).setValue('Vikas');
$x("P6_NAME").value='Vikas';
$("#P6_NAME" ).val('Vikas');
$s('P6_NAME','Vikas');

3. In case You want to Get or Set label text.

$("#P6_NAME_LABEL").text(); //to get lable text

$("#P6_NAME_LABEL").text('Vikas Pandey'); //to Set lable text

4. apex.debug.info(‘text’);

Enable the debug mode and check the console log.