Grow your CSS skills. Land your dream job.

JQuery – need to target iframe with src=”vimeo”

  • # March 9, 2011 at 1:52 pm

    How would I target iframe with a particular src?

    So far I have…

    $("iframe").each(function() {

    Thanks

    # March 9, 2011 at 2:30 pm

    This should do it:

    var ret = [];
    $("iframe").each(function() {
    var $this = $(this);
    if ($this.attr('src').match(/vimeo.com/ig))
    ret.push($this);
    });
    # March 9, 2011 at 2:56 pm
    $('iframe[src*="vimeo.com"]');
    # March 10, 2011 at 8:04 pm

    That’s great. Job done. I’m new to this, but having seen the tutorial on attribute selectors a couple of weeks ago that makes sense

    Thanks

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".