Monday, 26 August 2013

Using Codeigniter-code inside jQuery selector

Using Codeigniter-code inside jQuery selector

<?php foreach($platforms as $platform): ?>
<input type='button' value='Select' class="button" id="button_<?php
echo $platform->id ?>" />
<?php endforeach; ?>
<script>
$("#button_<?php echo $platform->id ?>").click(function(){
alert('something');
});
</script>
I do not get my example to work. Is there a way to embed codeigniter code
inside jQuery selector? If so how?

No comments:

Post a Comment