EASY UI 弹出窗口 怎么能到获取输入?

现在要用纯JS 做一个弹出窗口,窗口中有输入框,用户填写后,确定点击事件获取输入数据
代码如下:

 <a href="#" class="easyui-linkbutton" onclick="mes1()">弹出输入框</a>
<script>
        function mes1() {
            $.messager
                    .show({
                        id : "mes1",//窗口ID
                        title : '请输入',
                        msg : '<div style="" margin-left: 0px margin-top: 0px align="center">用户名称<input id="username" "><br>用户密码<input id="password"><div><input type="button" value="确定" onclick="f1();"><input type="button" value="关闭" onclick="f2();"></div></div>',
                        showType : 'fade',
                        timeout : 0,
                        closable : true,
                        modal : true,
                        draggable : true,
                        inline : false,
                        width : 200,
                        height : 200,
                        left : 200,
                        top : 20,
                        style : {
                            left : 600,
                            top : 200,
                            bottom : '??',
                        },
                        onBeforeClose : function() {
                            alert($("#mes1").window);
                        },
                    });
        };


        function f1() {
            //怎么能获取到输入
        }

        function f2() {
            //窗口关闭  
        }
</script>

新人求救!或者给一个能实现这样效果的案例也行 谢谢!