I have some JavaScript code that loops through a record set using a for loop. The ID of each record is assigned dynamically using this script. For example:
id="header1", id="header2", id="header3"
The numeral at the end of the id is assigned via script.
I also need to select these IDs via jQuery but I do not understand how to insert a variable into my jQuery selector.
I have tried the following (simplified for clarity):
This is the Superman film I had been waiting for. The tone was fine, yes a little more “fun” than previous outings but a lot of that came from supporting characters. Krypto was well handled, and somehow managed to not be an annoying distraction and actually a valid part of the story. Hoult was GREAT as Luthor. Genuinely so happy that this wasn’t crap.
I personally enjoyed Superman Returns, despite its flaws (tried too much to hide behind the older movies, had no real fight to Superman). I enjoyed the Man Of Steel movies despite their flaws (totally that is NOT Superman). But this - this is the film I had wanted.
In the UK we are far more reserved in cinemas than Americans. It’s rare that there is the whooping and hollering that we have seen from videos of US theatres, so when I say that the audience clapped at the end of this - it’s quite a big deal.
As for all this “Superman has gone woke” BS - he is freaking Superman and if at any point in that movie you found yourself pooh-pooing his actions, you are just - you’re aligning your thinking with the problems and not the solutions. I adore how the movie addressed the modern world through thinly veiled allegory (Israel, online bots, perceptions of people, how they change on a dime) - that is maybe one of the greatest strengths of comics, they rarely pull punches with that sort of thing, and look, THIS IS SUPERMAN, he’s meant to be the global boyscout and that is a strength and where he falls down sometimes, that’s just who he is and who he is meant to be. I also am glad there was no reference to the worldwide joke that is “Truth, Justice and the American way”.
They work like drug dealers. First we get free samples and when we like it they start charging for it. Wasn't there some uproar lately about the (possibly subbed) AI features in the new Nothing phones as well? Expect subs down the line, as AI cost a lot of money to run. And you're going to pay for it in the end 🤨
Question
raskren
I have some JavaScript code that loops through a record set using a for loop. The ID of each record is assigned dynamically using this script. For example:
The numeral at the end of the id is assigned via script.
I also need to select these IDs via jQuery but I do not understand how to insert a variable into my jQuery selector.
I have tried the following (simplified for clarity):
None of these things seem to work as jQuery doesn't select the objects I'm trying to get.
Any ideas on how to dynamically create jQuery objects using a counter variable?
Link to comment
https://www.neowin.net/forum/topic/696738-passing-a-variable-to-a-jquery-selector/Share on other sites
10 answers to this question
Recommended Posts