jquery - How can a class be added to a div via php? -
i have h tag below,
<h3 id="reply-title">
& needed add class remotely.
(this h3 tag located in comment-template.php. (line 1554) of wordpress core file in case wondering why can't hard code class it.)
i've done 1 line jquery (add class on .load) now, concerned since if javascript turned off, class won't added.
i have little knowledge of php , wondering if can done in php. i've done research on google & couldn't find reference.
any php expert can provide insight?
this in general bad practice, can this:
echo "<script>$('#reply-title').addclass('class')</script>";
but repeat: this bad practice. javascript must in .js files, , php in .php files.
however, if javascript disabled, think can't want.
hope helps.
Comments
Post a Comment