Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#13156 closed bug (notabug)

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".

Change History (3)

comment:1 Changed 6 years ago by Floresta <fernandoalbo@…>

Debug en Visual Studio 2008, IE7.

comment:2 Changed 6 years ago by dmethvin

Resolution: notabug
Status: newclosed

Please ask for help on the forum.

comment:3 Changed 6 years ago by dmethvin

#13157 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.