0

I'm trying a simple (or so I thought) radio input change command. I have the script below which changes the class of a box when a certain radio button is selected but it keeps coming up with

Uncaught SyntaxError: Unexpected end of input

I am using Wordpress and it works fine when it is in scripts.js but I need in in the page to put PHP within it.

$("#radio").on('change', 'input[type=radio]', (function() { 
  if ($("#port-filter-<?php echo ''.get_the_ID().''; ?>").is(":checked")) {
    $("#port-item-container").removeClass();
    $('#port-item-container').addClass('port-choice-<?php echo ''.get_the_ID().''; ?>');
  }
Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
Tommy
  • 23
  • 1
  • 5

0 Answers0