Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html lang="es">
- <head>
- <meta charset="utf-8" />
- <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
- <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
- <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
- <link rel="stylesheet" href="/resources/demos/style.css" />
- </head>
- <body>
- <input id="datepicker" type="text">
- <p class="dia"></p> <!--Se muestra el día seleccionado-->
- <p class="precio"></p> <!--Se muestra el precio correspondiente al día-->
- <script>
- $(function() {
- $('#datepicker').datepicker({
- dateFormat: "DD", // Sólo obtener DD en lugar de " d MM, yy"
- onSelect: function (dateText, inst) {
- $("p.dia").html( "Día = " + dateText ); // el día de la semana
- //hacemos la comparación día/precio
- if (dateText == "Monday" || dateText == "Tuesday" || dateText == "Wednesday" || dateText == "Thursday") {
- $("p.precio").html( "$3000" );
- }else if (dateText == "Friday" || dateText == "Saturday" || dateText == "Sunday") {
- $("p.precio").html( "$4000" );
- }
- }
- });
- });
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment