I am trying to access php variable inside jquery selector but it can't get to work. This php variable is taken from the views page from a foreach php statement. Check the code below.
HTML:
<?php foreach($items as $key => $value):?>
<div id="uploader<?php $value['id'] ?>">Upload</div>
<?php endforeach?>
The above code works concat string.
jQuery:
$(document).ready(function($) {
$("#uploader<?php echo $value['id'] ?>").uploadFile({
url:"YOUR_FILE_UPLOAD_URL",
fileName:"myfile"
});
});
Now I wanted to concat the php variable inside the jquery element selector but code above won't work. What would be the best thing to do here? Thanks