javascript - HTML div value not showing -


i have variable when show in alert shows values 1 when assign value div not show value on page.

<html>     <head>         <script src="jquery-1.6.2.min.js"></script>         <script >           var ad = ['a', 'b', 'c', 'a', 'd', 'e', 'a'];         var con=document.getelementbyid('data');         var inds = $.map(ad, function(v, i) {             //$("data").html(v);             return v == 'b' ? : null;         });         //con.innerhtml=inds;          alert(inds); // 0,3,6          var avr1=inds;         con.innerhtml=avr1;         </script>       </head>     <body>         <div id="data"></div>     </body> </html> 

<html>     <head>         <script src="jquery-1.6.2.min.js"></script>     </head>     <body>         <div id="data"></div>         <script>               var ad = ['a', 'b', 'c', 'a', 'd', 'e', 'a'];             var con=document.getelementbyid('data');             var inds = $.map(ad, function(v, i) {                 return v == 'b' ? : null;             });              alert(inds); // 0,3,6              var avr1=inds;             con.innerhtml=avr1;         </script>     </body> </html> 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -