jQuery cannot get value from textbox in Joomla, I am while using script because the follows:

<?php JHTML::_('behavior.jquery'); ?>
<script>
    jQuery.noConflict();
    jQuery(function(){

            jQuery("#register").click(function(){


                alert($("#txtusername").val());

            });


    });

</script>

<form name="frm1" id="frm1" method="get">
    <table border="0" style="width:100%;">
        <tr>
            <th colspan="2" align="center">Register</th>
        </tr>
        <tr>
            <td align="right">Username:</td>
            <td><input type="text" name="txtusername" id="txtusername"/></td>     
       </tr>
        <tr>
            <td align="right">Password:</td>
            <td><input type="text" name="txtpassword" id="txtpassword"/></td>
        </tr>
        <tr>
            <td colspan="2">&nbsp;</td>
        </tr>
        <tr><td>&nbsp;</td><td><input type="button" id="register" value="register"/></td></tr>
        <tr>
            <td colspan="2">


            </td>
        </tr>
    </table>
</form>

When you using jQuery.noConflict(). you cannot use $

you're notifying value using $

alert($("#txtusername").val());

change this as

 alert(jQuery("#txtusername").val());

take a look only at that working example