Ver Mensaje Individual
  #6 (permalink)  
Antiguo 04/08/2015, 09:13
Avatar de enlinea777
enlinea777
 
Fecha de Ingreso: mayo-2008
Ubicación: frente al pc
Mensajes: 1.830
Antigüedad: 16 años
Puntos: 127
Respuesta: variable JQUERY

dejo aqui tu inquietud

Código PHP:
<html>
<
head>
<
title>Documento sin título</title>
<
script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="js/jquery-ui.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script type="text/javascript">var oID="";</script> <!-- es necesario declarar el id como variable global, asi la puedes redefinir -->
</head>
<body>

<div id="prueba"></div>
<div id="prueba123"></div>

<input type='button' value='+' id='suma'>
<style type="text/css">

#prueba{
width:150px;
height:200px;
background-color: red;
}

#prueba123{
width:150px;
height:200px;
background-color:black;
}
</style>

<script language="javascript">
$(document).ready(function(){
$('div').click(function() {

oID = $(this).attr("id"); // cada que pinches un div la variable cambiara a el id de ese div.


$("#suma").click(function (){ $("#" + oID).append("<a href='#'><li>prueba</li></a>");})
})


});
</script>
</body>
</html> 
la explicacion esta en los comentarios