highlight_nodes(@nodes); sub highlight_nodes { my @nodes = @_; foreach my $node (@nodes) { my $objectId = $$node{objectId}; $mech->callFunctionOn( 'function() { if( "none" == this.style.display ) { this.style.display= "block"; }; this.style.backgroundColor = "red"; this.style.border = "solid black 1px" }', objectId => $objectId, arguments => [] ); } }