I have the following code in a content editor web part and it doesn't seem to work on my SharePoint new form page.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><script>$(document).ready(function(){
$("select[title='ProjectCode']").change(function(){
alert("The text has been changed.");
});});</script>
but this code does work.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><script>$(document).ready(function(){
$("input").change(function(){
alert("The text has been changed.");
});});</script>
I'd like to only change items of a specific ID or title. I've verified the title information is correct as well by inspecting the element in the developers tools in IE.
Can anyone see what I am doing wrong in my code?
$("select[title='ProjectCode']").length. Does it return zero? Then your selector is wrong.