How to add JavaScript to admin page

[ad_1]

Hi,

I would like to add a JavaScript code to admin page only. I didn’t find any option for it. I am able to add JS code to frontend only.

For example:

var oldVal = "";
$("#textarea").on("change keyup paste", function() {
var currentVal = $(this).val();
if(currentVal == oldVal) {
return; //check to prevent multiple simultaneous triggers
}

oldVal = currentVal;
//action to be performed on textarea changed
alert("changed!");

});

Could you help me how to add this code to admin page? What and how can I do this?

  • This topic was modified 1 day, 8 hours ago by whanklee.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer