I am working on Google Apps Script and using JQuery. I want to put multiple actual elements in the JQuery selector. I want to put actual elements in the selector.
I want:
$(kojiNameElem, tankaElem, suryoElem, unitElem)
not like(it works though):
$(".kojiName, .tanka, .suryo, .unit")
Please see this code followed:
var kojiNameElem = $("#koji_"+koji_id).find(".kojiName");
var tankaElem = $("#koji_"+koji_id).find(".tanka");
var suryoElem = $("#koji_"+koji_id).find(".suryo");
var unitElem = $("#koji_"+koji_id).find(".unit");
$(kojiNameElem, tankaElem, suryoElem, unitElem).on("focusin",function(e) {
console.log("focusin");
});
It works only on kojiNameElem
. The other elements don't.
I know it works with one single element in the JQuery selector as below.
$(kojiNameElem).on("focusin",function(e) {
console.log("focusin");
});
Could you help me please?