Onclick function “is not defined”

前端 未结 4 565
没有蜡笔的小新
没有蜡笔的小新 2020-12-28 20:08

I am fairly new to wordpress and am trying to define and call a function but cannot get it to work.

The following code appears in a php file that is called from the

4条回答
  •  抹茶落季
    2020-12-28 20:28

    I faced the same error like you.

    If we use the onclick html attribute, we need to define that onclick function within the same html element (by using tags).

    It is best practice to create click event listener using javascript/jquery, than using onclick html attribute.

提交回复
热议问题