最后输入的文本框标识

时间:2018-01-29 08:44:33

标签: jquery

我有一个这样的表格

:echo v:progpath
O:\tools\vim\vim.exe

如果我输入任何文本框中的任何内容,例如:如果我在第三个文本框中键入内容

$sourceDirectory = "C:\temp\source" $destinationDirectoryRoot = "C:\temp\destination" # Grab a list of XML source files $xmlFiles = Get-ChildItem -Path $sourceDirectory -Filter "*.xml" # Iterate over the files foreach ($xmlFile in $xmlFiles) { # Grab the content and cast to [xml] type [xml]$xmlContent = Get-Content -Path $xmlFile.FullName # We now don't need to use [icky] XPath $rentityId = $xmlContent.rentity_id # Do work if we found a value for rentity_id if ($rentityId) { # Variables for destination dir and file $destinationDirectory = Join-Path -Path $destinationDirectoryRoot -ChildPath $rentityId $destinationFile = Join-Path -Path $destinationDirectory -ChildPath $xmlFile.Name # Create destination folder (same name as XML file) New-Item -Path $destinationDirectory -ItemType Directory -Force | Out-Null # Move the source file to thenewly created destination directory Move-Item -Path $xmlFile.FullName -Destination $destinationFile -Force } else { Write-Warning "No rentity_id found in $($xmlFile.FullName)" } } # Confirm output Get-ChildItem -Path $destinationDirectoryRoot -Filter "*.xml" -Recurse | Select-Object FullName 点击文本框外部后需要收到消息

"您在fr-045"

中键入内容

任何jquery解决方案吗?

1 个答案:

答案 0 :(得分:0)

您可以使用简单的JQuery来实现此目的。您需要使用focusout事件:



$('input').on('focusout', function(){
  $('.message').text('You typed something in ' + $(this).data('identity-td'))
});

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div>
  <input type="text" data-identity-td="uk-021">
  <input type="text" data-identity-td="ae-033">
  <input type="text" data-identity-td="fr-045">
  <input type="text" data-identity-td="in-125">
</div>
<div class='message'></div>
&#13;
&#13;
&#13;