Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery dialog title dynamically

Tags:

jquery

how to change jquery dialog title dynamically here is the code we are using this will show normal title but we have to update depending on the code.

<!doctype html>
<html lang="en">
 <head>
   <meta charset="utf-8">
<title>jQuery UI Dialog - Default functionality</title>
<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>

<script>
$(function() {
  $( "#dialog" ).dialog();
 });
  </script>
 </head>
<body>

 <div id="dialog" title="Basic dialog">
     <p>This is the default dialog which is useful for displaying information.</p>
   </div>


   </body>
   </html>
like image 998
mahesh Avatar asked Dec 23 '13 10:12

mahesh


1 Answers

Like Jquery ui exemple, width var "dialog" you can use directly :

dialog.dialog({ title: "your title"});

Not need to use id div :)

like image 110
Laurent Zminka Avatar answered Dec 07 '22 20:12

Laurent Zminka