datetimepicker不想要我的php变量

I have a big problem which really confused me the last five hours.

I use datetimepicker.

<?php
$tabname = "frequency";
$datumstart = "'#datumstart".$tabname."'";
?>
<script type ="text/javascript">
$(function(){$(<?php echo $datumstart; ?>).datetimepicker();
</script>
<input type="text" name="datumstart<?php echo $tabname; ?/>

I want to get the value of the input-field with

$(function load() {
var datumstart = $(<? php echo $datumstart; ?>).val(); });

So everytime I want to run the file with this line

var datumstart = $(<? php echo $datumstart; ?>).val(); });

the alert-output of var datumstart is blank.

But with this

var datumstart = $('#datumstartfrequency').val(); });

I get the value!

What can be wrong?

You are missing apostrophes:

$('<?php echo $datumstart; ?>')