There is a line:

<a class='active' rel='0' alt='96771'>Web</a> 

How to get the value of the alt attribute, that is, only 96771 ?

I would be grateful for the help.

    1 answer 1

    jQuery

     $(".active").attr("alt"); 

    Php

     $link = "<a class='active' rel='0' alt='96771'>Web</a>"; preg_match("/alt='(.*?)'/i", $link, $match); echo $match[1]; // 96771 
    • you need it on php - iKey
    • @ Denis, through the regular season only if - Bert