Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML][Java]Zmiana koloru czcionki jednego elementu
senior.pol
post
Post #1





Grupa: Zarejestrowani
Postów: 158
Pomógł: 0
Dołączył: 10.08.2011

Ostrzeżenie: (0%)
-----


Witam,
Jak zmienić kolor tylko i wyłącznie znaku "*" na np. kolor czerwony w poniższym kodzie?

Kod
var texti = "Ile jest "+randomNr1+" + "+randomNr2+" ?"+" *";
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
senior.pol
post
Post #2





Grupa: Zarejestrowani
Postów: 158
Pomógł: 0
Dołączył: 10.08.2011

Ostrzeżenie: (0%)
-----


Kod
(function($){

    jQuery.fn.ebcaptcha = function(options){

        var element = this;
        var submit = $(this).find('input[type=submit]');
        $('<label id="ebcaptchatext"></label>').insertBefore(submit);
        $('<input name="captcha" type="text" id="ebcaptchainput"/><br/>').insertBefore(submit);
        var input = this.find('#ebcaptchainput');
        var label = this.find('#ebcaptchatext');
        
        $(element).find('input[type=submit]').attr('disabled','disabled');

        
        var randomNr1 = 0;
        var randomNr2 = 0;
        var totalNr = 0;


        randomNr1 = Math.floor(Math.random()*10);
        randomNr2 = Math.floor(Math.random()*10);
        totalNr = randomNr1 + randomNr2;
        var texti = "Ile jest "+randomNr1+" + "+randomNr2+" ?"+" *";
        $(label).text(texti);
        
    
        $(input).keyup(function(){

            var nr = $(this).val();
            if(nr==totalNr)
            {
                $(element).find('input[type=submit]').removeAttr('disabled');
            }
            else{
                $(element).find('input[type=submit]').attr('disabled','disabled');
            }
            
        });

        $(document).keypress(function(e)
        {
            if(e.which==13)
            {
                if((element).find('input[type=submit]').is(':disabled')==true)
                {
                    e.preventDefault();
                    return false;
                }
            }

        });

    };

})(jQuery);
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 12.10.2025 - 04:58