onClick not working

前端 未结 2 2012
暖寄归人
暖寄归人 2021-02-19 02:39

I want to turn my table rows into links using JS. I have it looking like this:


2条回答
  •  暖寄归人
    2021-02-19 03:14

    As you know, HTML attributes have to be surrounded by quotes, so if you need quotes within the attribute you need a different pairing. Try this:

    
    

    And if you are within a loop and echo'ing stuff out try PHP's HEREDOC syntax.

    $out = '';
    foreach ( $x as $y )
    {
    $out .= <<
    HTML;
    }
    echo $out;
    

    Edit: added HEREDOC

提交回复
热议问题