<html>
<script>
function check()
{
 alert(getFilePostfix(document.getElementById('aaaa')));
}
function getFilePostfix(oFile)
{
if(oFile == null)
return null;
var pattern = /(.*)\.(.*)$/gi;
if(typeof(oFile) == "object")
{
if(oFile.value == null || oFile.value == "")
return null;
var arr = pattern.exec(oFile.value);
return RegExp.$2;
}
else if(typeof(oFile) == "string")
{
var arr = pattern.exec(oFile);
return RegExp.$2;
}
else
return null;
}
</script>

<body>
<form >
<input type='button' onclick='check()' value='aaaaaaa'>
</form>
</body>
</html>

相关文章:

  • 2022-12-23
  • 2021-08-25
  • 2022-12-23
  • 2022-12-23
  • 2021-06-10
  • 2022-01-09
猜你喜欢
  • 2022-12-23
  • 2020-04-18
  • 2021-07-30
  • 2022-02-08
  • 2021-12-29
  • 2022-12-23
  • 2021-11-24
相关资源
相似解决方案