0

.selector property has been permanently removed in the JQuery version 3.0 so I'm confused about what should be the replacement of .selector? In my code I have used the .selector as below:

var TaxYearNode = $(EmployerLatestYear).find("TaxYear");
var TaxYear = $(TaxYearNode[j].firstChild.data).selector;

This line is showing an error as .selector property not available in JQuery 3.0 Please suggest the alternative way to resolve this problem in JQuery 3.6.3.

var EmployerLatestYear = xml.find("Table1"); 

for (var j = 0; j < EmployerLatestYear.find("ID").length; j++) {
 
var TaxYearNode = $(EmployerLatestYear).find("TaxYear"); 

var TaxYear = $(TaxYearNode[j].firstChild.data).selector; 
}
Gopal Biswas
  • 409
  • 1
  • 7
  • 34

1 Answers1

1

Here are few ways to get around the deprecation:

Get exact selector in jQuery / alternative to .selector

Get the current jQuery selector string?

For example:

index = document.getElementById('category').value
select = $("#category option[value=#{index}]")[0].innerHTML

source: https://stackoverflow.com/a/23304487/20394976

Monty
  • 36
  • 2