[Solved] How to Add background or change text


This really shouldn’t be done in jQuery, and you could still use a few lessons in being clear with what you’re looking for, but a question is a question, and here is my answer:

$('th').hide();
var $titlerow = $('tr td:first'), 
    $yearrow = $('tr:eq(1) td:first'),
    title = $titlerow.text(),
    year = $yearrow.text();

$titlerow.text(title + ' - ' + year);
$yearrow.remove();

Some things to note:

  • You should not be doing this is jQuery. You should rearrange your PHP. If the code is copy/pasted, then I suggest reading through it. I’ll be honest, I didn’t read a single line of what you posted, as it was irrelevant to a client-side question after you give a link.
  • You should be sure to include jQuery in your site. It is not on the page you linked to. Otherwise, the code I provided will not work.
  • You should put the above code in document ready. I left that last bit somewhat obfuscated. Reason being is that if you don’t understand any of this bullet point, some googling of the terms in it will do you good.

5

solved How to Add background or change text