Skip to main content

Bug Tracker

Side navigation

#13156 closed bug (notabug)

Opened January 05, 2013 05:10AM UTC

Closed January 05, 2013 01:46PM UTC

Last modified January 05, 2013 01:46PM UTC

Comportamiento raro

Reported by: Floresta Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.3
Keywords: Cc:
Blocked by: Blocking:
Description

Este código no funciona (Visual Studio 2008):

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Form1.aspx.vb" Inherits="JQuery.Form1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    
    <script type="text/javascript" src="jquery-1.8.3.js"></script>
    
    <style type="text/css">
        .Textos
        {
        	background-color:Yellow;
        }
        
        .Textos2
        {
        	background-color:Green;
        }
        
        .Textos3
        {
        	background-color:Red;
        }
        
    </style>
    
    <script type ="text/javascript">
    
        function Cambiar() { 
            
            $("#div1 input").addClass("Textos2");
    
        }
        
    </script>
    
</head>
<body>
    <form id="form1" runat="server">
    <div id="div1">
        
        <input type="text" id="txt1" class="Textos" value="Esto es un Input tipo Text" />        
        <br />
        
        <input type="text" id="txt2" class="Textos3" value="Esto es otro Input tipo Text" />
        <br />
        
        <input type="text" id="Text1" class="Textos" value="Esto es otro Input tipo Text" />
        <br />
        
        <input type="button" id="btnCambio" value="jquery" onclick ="Cambiar()" />
        
    </div>
    </form>
</body>
</html>

Pero cambiando de lugar algunas líneas si funciona!!!

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Form1.aspx.vb" Inherits="JQuery.Form1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    
    <script type="text/javascript" src="jquery-1.8.3.js"></script>
    
    <style type="text/css">
        .Textos
        {
        	background-color:Yellow;
        }
        
        .Textos3
        {
        	background-color:Red;
        }
        
        .Textos2
        {
        	background-color:Green;
        }
                        
    </style>
    
    <script type ="text/javascript">
    
        function Cambiar() { 
            
            $("#div1 input").addClass("Textos2");
    
        }       
        
    </script>
    
</head>
<body>
    <form id="form1" runat="server">
    <div id="div1">
        
        <input type="text" id="txt1" class="Textos" value="Esto es un Input tipo Text" />        
        <br />
        
        <input type="text" id="txt2" class="Textos3" value="Esto es otro Input tipo Text" />
        <br />
        
        <input type="text" id="Text1" class="Textos" value="Esto es otro Input tipo Text" />
        <br />
        
        <input type="button" id="btnCambio" value="jquery" onclick ="Cambiar()" />
        
    </div>
    </form>
</body>
</html>

Solo se colocó el estilo ".Text3" arriba del estilo ".Text2".

Attachments (0)
Change History (3)

Changed January 05, 2013 05:21AM UTC by Floresta <fernandoalbo@live.com.ar> comment:1

Debug en Visual Studio 2008, IE7.

Changed January 05, 2013 01:46PM UTC by dmethvin comment:2

resolution: → notabug
status: newclosed

Please ask for help on the forum.

Changed January 05, 2013 01:46PM UTC by dmethvin comment:3

#13157 is a duplicate of this ticket.