Jump to content

JavaScript onClick Uncaught Type Error: contentChanger is not a function


 Share

Recommended Posts

Всем привет, не могу преодолеть проблему onClick.
Сразу получаю эту ошибку.(Uncaught Type Error: contentChanger is not a function)

<script type="text/javascript">
function contentChanger(){
alert('Clicked');
}
</script>
<input type="button" id="contentChang" onclick="contentChanger()" class="ipsButton ipsButton_important ipsButton_medium ipsButton_fullWidth" value="Content Changer">

 

Место 'onClick'-а попробовал 'id' ,а этот не реагирует.

<script type="text/javascript">
function contentChanger(){
alert('Clicked');
}
document.addEventListener('DOMContentLoaded', function() {
  document.getElementById("contentChang").addEventListener("click", contentChanger);
});
</script>
<input type="button" id="contentChang" class="ipsButton ipsButton_important ipsButton_medium ipsButton_fullWidth" value="Content Changer">

 

У IPS есть ли функция[кнопка] призывающая функции JavaScript-a?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Ваша ссылка была автоматически строена.   Отображать как обычную ссылку

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...