Hi @zulfiqar.a.memon
FYI: You can debug PHP code like so without needing to use JS:
<?php
echo '<pre>';
print_r( get_field('cm_page_id') );
echo '</pre>';
die;
?>
What does the PHP print_r give you? Perhaps the returned value is an array or object?
Thanks
E