1

I have inputs hidden from PHP and I'm corventing it into javascript array. Now I need some function in jQuery like

$(".data").attr('data-day'== day).each(function(){});

I need this solution, no others... Thanks!

1
  • show the relevant html. What is day? How do you hide something from php? Commented Aug 2, 2015 at 17:36

1 Answer 1

4

Here's how you do it:

$(".data[data-day='" + day + "']").each(function() { 
    ...
});
Sign up to request clarification or add additional context in comments.

1 Comment

I think you should treat day as variable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.