Help for this page

Select Code to Download


  1. or download this
    for my $ele ($doc->findnodes('//img')) {
       if (!defined($ele->getAttribute('alt'))) {
          $ele->setAttribute(alt => ...);
       }
    }
    
  2. or download this
    for my $ele ($doc->findnodes('//img[count(@alt)==0]')) {
       $ele->setAttribute(alt => ...);
    }